Re: [exim] Attachment sizes - confusion

Etusivu
Poista viesti
Vastaa
Lähettäjä: Jasen Betts
Päiväys:  
Vastaanottaja: exim-users
Aihe: Re: [exim] Attachment sizes - confusion
On 2015-09-08, Osborne, Paul (paul.osborne@???) <paul.osborne@???> wrote:
> Hi,
>
> I have been playing with message size adjustments and I have noticed that when setting Exim's message_size_limit = 25M I would expect messages no bigger than 25 MB through.
>
> However I sent myself a file through to test this:
> -rw-r--r-- 1 po35 po35 24021574 Feb 15 2015 test-pdf.pdf
>
> Which is about 23MB in size and so was somewhat confused that when it got to Exim to find that I got the following message:
> message too big: size=32873715 max=26214400 (25MB)
>
> So whilst I appreciate some growth where the attachment is
>re-encoded and packaged up to be sent via email I was to be honest
>mildly surprised that there was a 25% growth in attachment size.


base 64 encoding gets you about about 37% growth

jasen@fozzie:~$ dd if=/dev/urandom of=8-bit count=100 bs=10000
100+0 records in
100+0 records out
1000000 bytes (1.0 MB) copied, 0.0784541 s, 12.7 MB/s
jasen@fozzie:~$ base64 < 8-bit | sed 's/$/\r/' > b64
jasen@fozzie:~$ ls -al 8-bit b64
-rw-r--r-- 1 jasen jasen 1000000 Sep 8 20:41 8-bit
-rw-r--r-- 1 jasen jasen 1368424 Sep 8 20:41 b64

sed in there is to convert the unix line endings /usr/bin/base64 produces to network
line breaks "CRLF"

> I am not going to be at all surprised if someone tells me that this
>increase can vary dependant on the encoding method and the type of
>data etc etc - but it does make things a bit of a pain when I need to
>advertise a hard figure as a maximum size that we will allow through
>our mail system when that does not correlate to what the user sees as
>a file size usage on their disk.          


yeah, if different encodings are used it does vary, worst case is more
than 200% bloat, best case is none). but most email clients use
base64 on large attachments, so go with 37% bloat.

set the limit to something like 40M (yahoo, hotmail, google etc all use something
like that as their limit) and tell your users the max total atttachment
size is 25M (they may discover that 28M works too, but are unlikely
to complain)

ESMTP size limits on three popular email services:

gmail: 250-SIZE 35882577
yahoo: 250-SIZE 41943040
live: 250-SIZE 36909875

--
\_(ツ)_