2

Since the mime encoding can increase a message's size by 33%, what is the correct math I need to do to filter messages larger than 45Mb? Is the math needed at all?

Does the math change among different versions of Exchange?

makerofthings7
  • 8,821
  • 28
  • 115
  • 196

1 Answers1

3

The Exchange size-limit is indeed the size of the actual message, not the decoded attachment size. So yes, you will have to do the math. Base64 encoding doesn't change from Exchange version to Exchange version, they've consistently been limiting on the size of the message in the mailer-queue (i.e. encoded).

That size is the full size of the message in the DATA block of the SMTP conversation. That's headers, body, and base64-encoded attachments (and in exceedingly rare cases, UUENCODED attachments! Those still work.). Since this is MIME, not simple b64, the math works out to an expansion factor of 1.37 (link). That is the 3 bytes into 4 bytes expansion (+.33), plus the terminal CRLF characters after ever 72 characters (+.04). Above and beyond this are the fixed costs of headers, actual body of the message, and the MIME headers inside the body; depending on how large the attachments are these costs may be negligible.

Simple B64 is 1.33, but MIME is 1.37.

So, for a 45MB message size limit (46080 kb), you need to set a limit of 63130 Kb.

sysadmin1138
  • 131,083
  • 18
  • 173
  • 296
  • It would be great to see a reference or validation of 37%. Please share if you come across something – makerofthings7 Oct 10 '10 at 16:31
  • @makerofthings7 it needs to be that exact? really? – Jim B Oct 10 '10 at 16:42
  • I'd like to know how 37% was derived. My clients may ask me where did I come up with that number – makerofthings7 Oct 10 '10 at 18:10
  • @MakerOfThings7 Headers and message bodies make up some overhead beyond just how big that .PPT file is, though of course it's a sliding scale the larger the attachment is. – sysadmin1138 Oct 10 '10 at 18:21
  • @makerofthings7, why try to invent some magic algorithm to predict the decoded size of a group of unknown type attachements, if you are trying to limit the size to 45 MB limit it to 45 MB. Exchange uses the queue size in order to avoid worrying about encoded size. – Jim B Oct 10 '10 at 18:45
  • @JimB - Sysadmin1138 says "So, yes, you will have to do the math". That seems to be opposite of what you are saying. I'm confused. – makerofthings7 Oct 11 '10 at 04:11
  • 1
    @makerofallthings7 - sorry if I wasn't clear, generally speaking admins limit size in order to reduce queuelength and reduce bandwith usage. So if you want it to be 45Mb only the encoded size "counts" since that's what gets tranmitted over the wire. Also the encoding growth is just rule of thumb accurate. Just playing I was able to set the limit suggested by sysadmin1138 (correctly btw) and was able to send a 50MB single attachment and unable to send 45 MB of various files attached. A better method if you want to limit attachment size (and not the send size) is to limit it on the client. – Jim B Oct 11 '10 at 16:23