Naar de inhoud
OneKitly

An Attachment Grows by a Third Inside the Email

Gepubliceerd op 7-9-2026 · 4 min leestijd · Bestandstools

Daniel Okonkwo

Daniel Okonkwo — Front-enddeveloper en techredacteur bij OneKitly

Webprestaties · Bestandsformaten

Getoetst aan 3 bronnen

Profiel bekijken →
Kort gezegd

Mail was designed to carry text, so a file has to be rewritten as text before it can travel. The encoding used is base64: every three bytes become four printable characters, and MIME then breaks the result into lines of 76 characters, each ending in a carriage return and a line feed. Three bytes as four is a fixed 1.3333 times, the line breaks add another 2.6 %, and the measured total is 1.3684 — a 10 MiB file occupies 13.684 MiB of the message. Working backwards, a 25 MB sending limit carries about 18.3 MiB of actual files, a 20 MB limit about 14.6 MiB, and a 10 MB limit about 7.3 MiB, before the message body and headers take their share. The extractor here reverses the encoding and gives you the original bytes back, byte for byte: the growth exists only inside the message.

Advertentie

Mail carries files as text, three bytes written as four characters. A 10 MiB attachment occupies 13.68 MiB of the message, which is why a 25 MB limit really means about 18 MiB of files.

Why a file cannot travel as itself

The mail protocols were written when a connection guaranteed seven bits per character and nothing else. A byte from a PDF or a photograph can be any of 256 values, several of which mean something to a mail server — a lone carriage return, a null, a line that happens to start with a full stop. Base64 sidesteps all of it by using only 64 characters that every system agrees about, at the cost of writing four of them for every three bytes. The arithmetic is not an implementation detail you can optimise away: it is the price of the guarantee that the file arrives identical.

It also explains why compressing before attaching helps and re-compressing an already compressed file does not. A folder of documents zipped down to a third of its size costs a third of the base64 too, because the encoding is applied to whatever bytes you hand it. A photograph or a PDF is already compressed, so zipping it saves nothing and the 1.3684 still applies to the full size.

Getting the files out, and the names right

Each attachment sits in its own part of the message, with a Content-Type saying what it is and a Content-Disposition giving the filename the sender chose. Both can be RFC 2047 encoded, so a French invoice can be named =?UTF-8?B?ZmFjdHVyZSBqYW52aWVyLnBkZg==?= in the raw file and Facture janvier.pdf once decoded — the extractor decodes it, which is the difference between a folder of readable names and a folder of gibberish. Filenames also survive spaces and accents intact, both of which some older extraction scripts mangle.

Files that fit
What a sending limit really carries
Stated limitFiles that fitEncoded size
25 MB18.3 MiB25 MB
20 MB14.6 MiB20 MB
10 MB7.3 MiB10 MB
One 10 MiB file10 MiB13.68 MiB (×1.3684)
Bijlagen uit een e-mail halenHaal elke bijlage uit een opgeslagen .eml-bericht en download ze afzonderlijk.Probeer de tool →
Advertentie

Veelgestelde vragen

Is the extracted file identical to the one that was sent?
Yes. Base64 is a lossless encoding, so decoding gives back exactly the bytes that went in — the checksum of the extracted file matches the original. That is why mail can carry a signed PDF or a piece of software without corrupting it, and why the size you see on disk after extraction is the real size rather than the encoded one.
Why is my mailbox bigger than the files I remember receiving?
Partly this, and it adds up. Every attachment you ever received is stored encoded, so a mailbox holding 3 GiB of files takes about 4.1 GiB. On top of that, a message you sent with an attachment is usually kept twice — once in Sent and once in the thread — and a forwarded message carries its attachments again. Extracting and deleting the largest attachments is generally worth more than deleting hundreds of small messages.
Can I get an attachment out of a message that will not open?
Often, yes, and that is one of the better reasons to have this tool. A message whose HTML defeats a mail client is still a well-formed MIME file, and the attachment sits in its own part with its own encoding; the extractor reads the structure rather than rendering the message, so a body that will not display does not stop the file coming out.

Artikelen die je misschien interesseren

Alle gidsen →
UitlegEmail HTML Is Twenty Years Behind the Web, on PurposeNo stylesheet, no script, layout built from nested tables and styles written on every single tag. Knowing why explains what an exported HTML file will and will not look like.HandleidingSplitting a Mail Archive Into One File per MessageAn .mbox is one enormous file your operating system cannot search. Turn it into .eml files and every message becomes something your machine indexes, your mail client opens and you can delete one at a time.UitlegWhy Your Subject Line Arrives as =?UTF-8?B? and a String of LettersMail headers are allowed to carry ASCII only, so an accented subject is encoded before it travels. Two encodings are in use, both start with =?, and decoding them is the whole difference between a readable message and a wall of symbols.UitlegAn .mbox Is Messages Glued End to End, and the Glue Is a LineOne file, thousands of messages, separated by a line beginning From. The format has one famous weakness, and it is the reason a message can lose its ending without anything reporting an error.HandleidingOpening an .eml File Without Telling the SenderA saved message is a text file you can read anywhere. The catch is that opening it in something that loads remote images announces the moment you did — which is what a tracking pixel is for.HandleidingOne File per Tab, and What a Split Leaves BehindSplitting a workbook writes one .xlsx per sheet, named after the tab. It carries the values across and not the formulas — which is the right default when the point is to send one department its own tab.

Vergelijkbare tools

Bronnen

Een fout in dit artikel gezien?