Postfix message size limit. Change the maximum attachment size in Exchange and Outlook

Codes of the Russian Federation 06.04.2020

Prerequisite: The mail server is implemented using the postfix+dovecot+roundcube combination. The roundcube web interface in the "Add Attachment" pop-up window indicates: Maximum file size 2 MB. Accordingly files bigger size are not attached.

Note: postfix defines restrictions Not investments, and Total letters. In the default configuration, the default letter size limit was 10MB. Therefore, Roundcube, when displaying a message about the maximum size of 2MB, is in no way guided by the postfix configuration. Being an application written in PHP, Roundcube focuses on the PHP server configuration. However, it is necessary to remember that the size of the letter consists not only of the attachment, but also of the text of the letter and service code. Therefore it is necessary to install higher value the permissible message size is greater than the permissible attachment size.

1. In the configuration file /etc/postfix/main.cf, you need to enter a parameter that determines the maximum permissible message size, since it is not present in the default configuration. For example, set as the maximum allowed size mail message 25 MB.

#postconf -e message_size_limit=25600000

# postfix reload

In this case, you need to make sure that the size of the letter does not exceed the maximum allowable size of the user's mailbox.

#postconf -d- displays default server settings

mailbox_size_limit = 51200000

message_size_limit = 25600000

virtual_mailbox_limit = 51200000

From the listing you can see that with a maximum mailbox size of 50MB, we increased the letter size to 25MB. This way the box won't last long. In this case, it is advisable to increase the box size, for example, to 200MB.

Again, when viewing the configuration file, we will not find the parameters mailbox_size_limit and virtual_mailbox_limit, so we add them:

#postconf -e mailbox_size_limit = 204800000

# postconf -e virtual_mailbox_limi = 204800000

# service postfix restart

Checking the actual values:

# postconf -n mailbox_size_limit
mailbox_size_limit = 204800000
# postconf -n virtual_mailbox_limit
virtual_mailbox_limit = 204800000
# postconf -n message_size_limit
message_size_limit = 25600000
#

2 . All of the above manipulations are meaningless until we allow php to work with files of this size.

The maximum file size that can be uploaded using a php script is determined in the file /etc/php.ini

; Maximum size of POST data that PHP will accept.

post_max_size = 16M

; Maximum allowed size for uploaded files.

upload_max_filesize = 16M

; Maximum amount of memory a script may consume

memory_limit = 64M

After editing php.ini you need to restart apache

#service httpd restart

3. If the roundcube user session has been open all this time, then you need to re-authorize.

If you receive an email from Mailer-Daemon with the subject “Undelivered Mail Returned to Sender,” it means that the sent email was not delivered to one or more recipients. The reason why the original email was not delivered is indicated at the end of the notice on English language. The most common reasons are listed below.

Invalid recipient address


User not found
User unknown
No such user here
Unrouteable address
Invalid mailbox
Mailbox unavailable

This error may mean that you are trying to send an email to a non-existent address. Please check the recipient's address and try again.

Example error message:
: host mail.example.com said: 550 5.1.1
: Recipient address rejected: User unknown in local
recipient table (in reply to RCPT TO command)

There is no free space in the recipient's mailbox

The error message contains the lines:
account is full
Quota exceeded
User has exhausted allowed storage space
error writing message: Disk quota exceeded

The message size is greater than the limit on the recipient's server

The recipient's server has set a limit on the maximum message size. If you are sending multiple files, try sending them in several different emails.

Example:
message size 7520647 exceeds size limit 6000000 of server mail.example.com

This means that a letter of 7.5 megabytes in size was sent, but the recipient's server accepts letters no larger than 6 megabytes in size.

The recipient's server does not accept mail

The error message contains the line:
Operation timed out

The recipient's server is down. Perhaps you made a mistake in the recipient's address and the letter was sent to the wrong server. If the address was entered correctly, try contacting the recipient using a different address.

A non-delivery report is a message that is sent by the mail server to the sender when the recipient's mailbox is unavailable, does not exist, or the sender/recipient server reports an error due to which it cannot deliver the letter to the recipient within the allotted time.

The text of the letter contains the error text, mailbox address, error code and the reason why the letter could not be delivered.

For detailed error codes, please refer to RFC 3463.

We will give examples of the most common errors when emails are not delivered.

# Error: No such user (User not found / No correct recipients / Bad recipient address syntax / Bad address mailbox syntax)

The error indicates that the recipient's email does not exist on the remote server. Check that the recipient's address does not contain extra characters, spaces or symbols. Please confirm the address with the recipient again or try to contact the recipients using alternative methods.

# Error: Message rejected under suspicion of SPAM

If the report contains the line “Message rejected under suspicion of SPAM,” the contents of your email have been detected as spam. Contact the support service of the server that rejected your letter to find out the cause of the problem.

If only spam comes from your mailbox, then some mail servers block receiving letters from it for 24 hours. In this case, the NDR will contain the line “Client host [ ] blocked using spamsource.. ; see..." or "Blocked by spam statistics - see...".

If you are sure that your computer is not infected with a virus and that spam was not sent from it, please report this to the support service of the server to which the letter was sent using the form feedback, attaching a file of the letter with the report to the letter.

# Error: 550 spam message discarded/rejected

Your email has been blocked by the antispam filter system. To solve this problem, you need to temporarily stop the mailing and make the necessary settings in accordance with.

#Error: 550 relay not permitted

There may be several reasons for this error to appear:

Authorization when sending is not enabled in the mail client settings;

MX servers have incorrect values ​​or for other reasons, which can be clarified with the owners of the MX servers.

# Error: Connection timed out/C onnection refused / retry time not reached for any host

T What errors usually result fromtechnical problems on the recipient's mail server. Try waiting a while and trying again, or contact the recipient using alternative methods.

# Error: Mailbox Full or User quota exceeded / Mailbox size exceeded

This issue occurs because the recipient's mailbox is full. Try waiting a while and trying again, or contact the recipient using alternative methods.

# Error: Access to this account (user) account_name is disabled or Mailbox is disabled

This error is issued due to the fact that the recipient's mailbox has been deleted or blocked for lack of use. Try contacting the recipient through alternative means.

# Error: 550 Access from ip address blocked

Most likely your IP address is on one of the blacklists. IN in this case contact us at technical support for advice.

# Error contains the code "0x800CCC"

To solve this problem, try changing the SMTP port from 25 to port 2525 or 587 in the settings of your mail program.

If all this does not help, then try using your provider's SMTP server to send.

# Error: Message infected by virus

If the report shows the error “Message infected by virus,” this means that your email was flagged by the recipient's mail server as infected with a virus.

# Error: The recipient has exceeded their message rate limit. Try again later

If the report shows the error “The recipient has exceeded their message rate limit. Try again later", delivery of letters to the recipient's address was temporarily suspended due to the large number of letters arriving in his mailbox per unit of time. Try resending the email in 6 hours.

# Error: Message size exceeds fixed limit (Error: message file too big)

If the report contains the line "Error: message file too big" or "Message size exceeds fixed limit", the attachment you send in the email cannot be accepted by the mail server due to its restrictions.

The maximum size of emails with attachments should not exceed 10 MB.


# Error: too many connections

If the error “Error: too many connections” appears when sending a message, your mail server creates a large number of calls to a third-party mail server per unit of time, which leads to an increase in load and slowdown. Try contacting the administration of your mail service alternative way contact and report the problem.

# Error: too many recipients

If the error “Error: too many recipients” appears when sending a message, your message has too many recipients: more than 100 addresses in the fields To whom, Copy And Hidden copy. Edit the recipient list and try again.

We recommend reading

Top