Ukdah

Untangle the message.

Raw email is headers, encodings, boundaries, and replies. Ukdah turns it into readable Ruby objects without becoming a mail client.

message.emlRFC 5322 / MIME
FromAda <ada@example.com>
ToReader <reader@example.com>
SubjectA field note for you
Date21 Sep 2026, 09:30

Decoded text

Hello,

Here is the note and the image we discussed.

Ada

MIME structure

multipart/mixedtext/plaintext/htmlimage/pngattachment: note.png
diagnostics: no parsing errors

Keep every useful part.

Headers, bodies, attachments, and conversation references stay separate, so the application can decide what to show.

Headers

Folded lines, encoded words, addresses, and RFC 2231 parameters.

MIME

Multipart trees, base64 and quoted-printable bodies, attachments, and inline CID parts.

Archives

Split mbox data into messages and group replies by Message-ID references.

Recovery

Keep diagnostics when a damaged message can only be parsed in part.

Parse only. Decide the rest.

Ukdah never connects to IMAP, POP, or SMTP. It does not sanitize HTML: clean mail content before display and treat attachment filenames as untrusted.

Charset decoding uses Ruby by default. Applications can inject their own decoder.

require "ukdah"
message = Ukdah::Message.parse(File.binread("message.eml"))
puts message.subject
puts message.decoded(message.text_part)
puts message.diagnostics