Postfix – How to Change the Maximum Mail Size

attachmentcentos6emailpostfixquota

When sending large email to a new CentOS6 server running Postfix as the MTA, the following message is returned:

tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 552 552 5.3.4 Error: message file too big (state 18)

I found the following suggestion, but am unclear as to where it needs to be added in the main.cf file:

This was caused by Postfix and it's limit on not only messages but mailbox sizes.

I had to add this setting in /etc/postfix/main.cf:

message_size_limit = 31457280

How can the maximum mail size (including attachments) be increased in Postfix?

Best Answer

Add it anywhere in main.cf, it's not relevant :) But it's good to keep directives grouped in some logical manner, it is easier for maintance

According to official postfix documentation:
message_size_limit (default: 10240000) The maximal size in bytes of a message, including envelope information. Note: be careful when making changes. Excessively small values will result in the loss of non-delivery notifications, when a bounce message size exceeds the local or remote MTA's message size limit.

Additionally, the default mailbox size of 50M may prevent mail from being delivered, especially after increasing the permitted message size. To increase maximum per user mailbox size, add mailbox_size_limit = <size in bytes> to main.cf.

Additionally, as Ian Sparkes commented, if you are using a virtual mailbox configuration, you might need to set virtual_mailbox_limit = <size_in_bytes>.

Related Topic