moonmime

    Byte-preserving recursive MIME message parser for MoonBit

    mime
    email
    eml
    rfc5322
    multipart
    Download zip
    Author
    Version
    0.2.0
    License
    Apache-2.0
    Last updated
    2 hours ago
    Downloads
    6

    Dependencies

    #MoonMIME

    Bounded, byte-preserving MIME security inspection for MoonBit.

    let message = @moonmime.parse(
    b"Subject: hello\r\nContent-Type: text/plain\r\n\r\nMoonBit",
    )
    inspect(message.root.media_type.essence(), content="text/plain")

    v0.2 adds a deterministic security audit layer over ordered and folded headers, recursive multipart/*, direct message/rfc822, Base64, Quoted-Printable, RFC 2047 encoded-words, and RFC 2231 extended parameters. Findings identify parser ambiguity and unsafe extraction metadata with a stable code, severity, entity path, and exact source byte range.

    The parser does no network or filesystem I/O. The separate Native CLI can inspect or audit a local .eml; audit --fail-on high supports quarantine/CI policy without decoding or extracting attachments.

    See the repository README for the full guide, scope, resource limits, security model, standards matrix, and testing instructions. Licensed under Apache-2.0.

    audit

    Parse and audit untrusted message structure without decoding attachments.

    audit_json

    Parse and return stable moonmime.audit.v1 JSON for security pipelines.

    decode_body

    Decode a selected entity body after validating its source range.

    edge_limits

    Re-export the smaller edge-oriented limits through the root package.

    inspect_json

    Parse and return the stable v1 JSON inspection report.

    inspect_text

    Parse and return the human-oriented entity summary.

    parse

    Parse with secure resource defaults and strict RFC-oriented behavior.

    secure_limits

    Re-export the secure default limits through the root package.

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io