You are here: |Blog|Server Administration|Adjust The Message Size In Postfix

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[56145]: A1B2AB123456: to=<root@server01.example.com>, 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?


We will be delighted to hear from you

Why choose us?

Choosing the right web development and digital marketing company is crucial to the success of your online presence, and ILUS Web Ltd is the perfect choice for businesses looking to establish a strong and effective online presence. Our team of experts is dedicated to providing top-notch web development and digital marketing services that are tailored to meet the unique needs of our clients.

With over a decade of experience in the industry, we have a proven track record of delivering high-quality solutions to businesses of all sizes. Our team of skilled developers, designers, and digital marketing experts use the latest technologies and best practices to deliver innovative, effective, and user-friendly solutions that exceed our clients' expectations. Whether you need a new website, an e-commerce platform, or a custom web application, we have the expertise to make it happen.

We at ILUS Web love programming!
All kinds of programming... Applications programming, Microcontrollers programming, Websites programming.
And we like to try to approach perfection everytime!

The best thing about a boolean is even if you are wrong, you are only off by one bit.

A beautiful and functional design is very important, as it interacts directly with the end User. And after all, it's the User's experience that we all work for!
Because a happy User, is of the most valuable assets to a business!

If you think good design is expensive, you should look at the cost of bad design.

A Website without S.E.O. is like a ship with broken steering, sailing in stormy weather!
In this day and age, the number of websites is reaching new records every day. Consequently, the competition of every new Site is huge, and the only way to "survive" is a methodical and successful S.E.O.

S.E.O. is what the Search Engines talk about you, when you are not present!
chart