Adjust the message size in Postfix
Postfix is one of the most popular MTAs (Mail Transport Agents). Due to its popularity, it is handling the mail for many different users and in many different kinds of environments. Therefore some of it's default settings may occasionally need some adjustments.
When browsing the logs of your mail server, have you ever seen something like that?
Sep 26 03:05:01 server01 postfix/local: A1B2AB123456: to=<firstname.lastname@example.org>, orig_to=<root>, relay=local, delay=0.18, delays=0.08/0.03/0/0.07, dsn=5.2.2, status=bounced (cannot update mailbox /var/mail/root for user root. error writing message: File too large)
Or, did your users complaint that they cannot receive -hmm, these kinda ...larger- attachments?
Well that is because Postfix is adjusted by default to handle messages up to 10240000 bytes, or approximately 10MB. Now think that MIME encoding adds an overhead of 33.33% to the size of any attachment. That's because every 3 bytes are being increased by 1, to a total of 4 bytes. So one can easily understand that the default maximum allowed attachment size is about 7MB!
If we want to increase that -rather small number, all we have to do is login as root to our mail server and edit the Postfix main configuration file (main.cf), usually located in /etc/postfix
# vi /etc/postfix/main.cf
Then find the command message_size_limit and make it equal to a larger number. Maybe something like 100MB...
message_size_limit = 102400000
Save the file and exit.
Oh, and don't forget to restart (or reload) Postfix!
This small adjustment of 100 Megabytes limit minus the MIME overhead, means that our server should now be able to accept messages up to 70MB! Not bad huh?