Обновлено: 15.11.2021
Опубликовано: 18.05.2017
Почтовый агент Postfix позволяет задавать различные ограничения, таймауты и лимиты. В данной инструкции мы рассмотрим примеры, как это сделать. Используемые значения подойдут для средне статистического сервера, однако, в каждой среде необходимо наблюдение и приведение параметром к оптимальному виду.
Редактирование конфигурационного файла
Размер почтового ящика
Размер отправляемого сообщения
Количество сообщений
Очередь сообщений
Таймаут на отправку
Сообщения об ошибках
Ошибка message size exceeds fixed limit
Работа с конфигом postfix
Редактирование конфигурационного файла Postfix
Изменения делаем в конфигурационном файле:
vi /etc/postfix/main.cf
* для FreeBSD путь будет /usr/local/etc/postfix/main.cf.
После редактирования не забываем перечитывать изменения командой:
systemctl reload postfix
* для FreeBSD или старых систем на базе Linux вводим service postfix restart.
1. Размер почтового ящика
Для установки квоты на почтовые ящики редактируем следующее:
mailbox_size_limit = 209715200
virtual_mailbox_limit = 209715200
* значение указывается в байтах. В данном примере установлены квоты для почтовых ящиков и виртуальных почтовых ящиков в 200 мб. Для удобства, воспользуйтесь конвертером мегабайт.
Чтобы снять ограничения, можно выставить значения в 0:
mailbox_size_limit = 0
virtual_mailbox_limit = 0
2. Размер отправляемого сообщения
Открываем конфигурационный файл, находим и правим следующее (если строки нет, создаем):
message_size_limit = 73400320
* в данном примере установлено ограничение на размер письма в 70 мб.
Необходимо, чтобы данный размер не превышал размер почтового ящика (mailbox_size_limit и virtual_mailbox_limit, которые по умолчанию имеют значения 51200000 или 50 мб), в противном случае, в логе мы увидим ошибку fatal: main.cf configuration error: mailbox_size_limit is smaller than message_size_limit.
Для этого можно либо задать значения равные (или больше) message_size_limit:
message_size_limit = 73400320
mailbox_size_limit = 73400320
virtual_mailbox_limit = 73400320
… либо отключить ограничения:
message_size_limit = 73400320
mailbox_size_limit = 0
virtual_mailbox_limit = 0
3. Количество сообщений и одновременных подключений
В конфигурационном файле добавляем такие строки:
anvil_rate_time_unit = 60s
smtpd_client_message_rate_limit = 200
smtpd_client_recipient_rate_limit = 60
smtpd_client_connection_count_limit = 20
smtpd_client_connection_rate_limit = 40
* в данном примере мы установили следующие ограничения на количество отправляемых писем:
- anvil_rate_time_unit — параметр расчетного времени. Именно от него будут вести отчет другие значения. По умолчанию также равен 60s.
- smtpd_client_message_rate_limit — сколько клиенту можно отправлять сообщений за anvil_rate_time_unit. По умолчанию 0, то есть, ограничений нет.
- smtpd_client_recipient_rate_limit — максимальное количество получателей за anvil_rate_time_unit. По умолчанию 0, то есть, ограничений нет.
- smtpd_client_connection_count_limit — количество одновременно разрешенных подключений для клиента. По умолчанию 50.
- smtpd_client_connection_rate_limit — максимальное количество коннектов, разрешенных для клиента за anvil_rate_time_unit. По умолчанию 0, то есть, ограничений нет.
4. Очередь сообщений
queue_run_delay = 5m
minimal_backoff_time = 10m
maximal_backoff_time = 15m
maximal_queue_lifetime = 1d
* где queue_run_delay задает время, как часто сообщения из очереди будут отправляться повторно; minimal_backoff_time устанавливает время, на которое будет отложена отправка сообщений, которые не были отправлены по причине временных неисправностей (например, принимающий сервер не отвечает или просит повторить запрос позже), но не позднее maximal_backoff_time; параметр maximal_queue_lifetime установит, через какой период перестать делать попытки при отправке сообщения и вернуть его отправителю с ошибкой.
5. Таймаут на отправку сообщений
smtp_data_done_timeout = 600s
smtp_data_init_timeout = 120s
smtp_data_xfer_timeout = 180s
* где smtp_data_done_timeout — ограничение времени для отправки сообщения; smtp_data_init_timeout — ограничение времени для отправки команды SMTP DATA и для получения ответа удаленного SMTP-сервера; smtp_data_xfer_timeout — ограничение времени для отправки содержимого сообщений.
6. Отправка сообщений об ошибках (4xx or 5xx)
smtpd_error_sleep_time = 3s
smtpd_soft_error_limit = 5
smtpd_hard_error_limit = 10
* где:
- smtpd_error_sleep_time — задержка перед отправкой сообщения об ошибке (4xx or 5xx). По умолчанию 1s.
- smtpd_soft_error_limit — количество ошибок, которые должны быть сделаны, прежде чем наш сервер начнет замедлять ответы. По умолчанию 10.
- smtpd_hard_error_limit — максимальное количество ошибок, которые может сделать удаленный сервер SMTP. После с ним будет разорвана сессия. По умолчанию 20.
552 5.3.4 message size exceeds fixed limit
Если сталкиваемся с сообщением «552 5.3.4 message size exceeds fixed limit» (переводится как «Размер сообщения превышает установленные ограничения»), значит отправляемое письмо не вписывается в установленные лимиты. Чтобы исправить ситуацию, уменьшаем размер сообщения или редактируем лимиты (пункты 1 и 2).
То есть, размер message_size_limit не должен превышать mailbox_size_limit и virtual_mailbox_limit.
Работа с конфигом postfix
Неколько полезных консольных команд по работе с конфигурацией.
1. Посмотреть значение параметра по умолчанию:
postconf -d <Параметр>
Например:
postconf -d mailbox_size_limit
2. Посмотреть текущее значение параметра:
postconf -n <Параметр>
Например:
postconf -n message_size_limit
3. Изменить значение:
postconf -e «<Параметр = значение>»
Например:
postconf -e «virtual_mailbox_limit = 0»
Users sending messages with attachments to recipients hosted in Exchange servers can end up receiving bounce mails due these attachments.
Our Support Engineers support hundreds of Exchange servers for web hosts, web designers and other online businesses.
In these servers, we’ve seen huge attachments or unsupported attachments formats causing email error 552.
The error message seen by the senders in the bounce mail in cases of huge attachment size limit would be error 552 – ‘5.3.4 Message size exceeds fixed maximum message size’.
If the bounce happens due to the content of the attachment, the error message would be similar to error 552 – ‘5.7.0 Our system detected an illegal attachment on your message.’
What is email error 552 ‘5.3.4 Message size exceeds fixed maximum message size’
Every mail server has custom settings for the size of mails users can send and receive through it. These limits can either be global or individual-account specific or both.
To limit bandwidth usage, this email size limit is often restricted to a few MBs in most servers. If the email size exceeds that limit, it will be rejected by the mail server.
Error 552 ‘5.3.4 Message size exceeds fixed maximum message size’ is an email error commonly seen in bounce messages that generate from recipients using Exchange mail server.
In an Exchange server, there are mainly 4 settings for message size limitations:
a. Global value for the mail server b. Receive and Send Connectors setting c. SMTP Virtual Server setting d. Individual user mailbox restriction
If the message size in the email exceeds any of these limits that are allowed for a particular email user account, it will be rejected with this error 552 message.
To resolve a valid email bouncing with error 552, these attachment limits have to be increased or adjusted appropriately.
But before we get into the detailed steps on how to increase these limits to accept valid user mails with attachments, we’ll see how these message size limits are to be calculated.
[ Worry no more about web or mail errors. Get an experienced Support Engineer to manage your servers for as low as $12.99/hour. ]
How to determine the email message size limits?
In Exchange mail servers, content conversion happens for mails. Exchange server converts an internet/MIME message to MAPI/Exchange format, and vice versa for transmission.
After this content conversion process, the message size generally increases by about 30%. As a result, a message of 9 MB may fail to deliver to a server with size limit 10 MB.
Also, the precedence of the message size limits has to be noted before changing the settings. The maximum allowable message size for a server should be set as the organizational limit.
If the message is sent to or received to the server from a user on the Internet, this organizational limit will be applied to that mail.
But for internal users who send mail to each other after successful authentication, the user mailbox limit takes precedence over all other size restrictions.
So, for a server to accept messages from the internet with size around 15 MB, all the message limits should be set at 20 MB, considering the content conversion size.
How to fix error 552 ‘5.3.4 Message size exceeds fixed maximum message size’ in Exchange server
To accept mails of large sizes from valid senders, the message size settings have to be increased in the server. Here’s how to do it for each limit:
1. How to increase global message size settings
The global default message size limit for Exchange Servers 2007 to 2010 is 10 MB. To change this value, the steps are:
1. Open the Exchange Management Console. 2. Click on Organization Configuration -> Hub Transport. 3. Click on Global Settings -> Transport Settings. 4. On the Properties -> General tab, set the maximum send and receive size limits.
This is the organizational setting and would be applicable to all mails sent and received from that server over the internet.
Increase global message size limits in Exchange server
2. How to change message size limits for Receive connector
Receive connectors are the gateways through which all inbound messages are received to a mail server.
The maximum message size limit for a mail that can be received on a receive connector can be set by:
1. Open the Exchange Management Console 2. Click on Server Configuration -> Hub Transport 3. Select a Hub Transport server 4. Click on Receive Connectors 5. Choose the receive connector and Click on Properties 6. Click on the General tab and set the maximum message size
Setting a limit on receive connector can further limit the message size based on the sender’s IP address or type.
3. How to change message size limits for Send connector
Send connectors are configured to change the email sending behavior in server. To change the maximum message size limit on send connectors, do these steps:
1. Open the Exchange Management Console 2. Click on Organization Configuration -> Hub Transport 3. Click on Send Connectors 4. Choose a send connector and Click on Properties 5. Click on the General tab and set the maximum message size.
This limit is used to limit the size of outgoing mails from a server.
[ Tired of repeated mail errors? Our Support Engineers can take care of your servers and support your customers 24/7. Click here to know more. ]
4. How to increase message size settings for individual mail accounts
The individual mailbox settings can be changed from Exchange Administration Center (EAC). Here’s how to do it:
1. In the EAC, go to Recipients > Mailboxes. 2. Select the mailbox that you want to change the message size limits for, and then click Edit. 3. On the mailbox Properties page, click Mailbox Features. 4. Under Message Size Restrictions, change the following message size limits: 5. Sent messages - sets the maximum size of message that can be sent by the user. The value has to be set in KBs. 6. Received messages - give the maximum size of messages that can be received by this user account in KBs. 7. Click OK and Save the changes.
User mailbox settings are usually set to limit or override the default global size of email messages sent between users within the same server.
All these email settings should be verified one by one to ensure that mails to the recipients are delivered successfully without bouncing with the error 552 ‘5.3.4 Message size exceeds fixed maximum message size’.
In short..
552 email error due to message size limit can show up in other forms too, such as:
- 552 5.2.3 Message exceeds local size limit.
- 552 5.3.4 Message size exceeds fixed limit
- 552 message size exceeds maximum message size
- 552 size limit exceeded
The message size and attachment size for messages should be set to appropriate limits, for successful mail delivery to happen. But its not advisable to increase the message size unnecessarily, as it will end up overloading the server.
Other than editing the email limit settings, techniques such as email compression can also be used in specific cases. Also, straight-away making server setting changes is not recommended as it may tamper with its normal functioning.
Email error debugging involves examining the server logs, checking the bounce message, identifying the error-generating server and cross-checking the server settings.
If you’d like to know how to secure your mail server and prevent email bounce errors, we’d be happy to talk to you.
552 5.3.4 Message size exceeds fixed maximum message size
calendar_today
Updated On:
Products
Email Security.cloud
Issue/Introduction
Despite raising your Message Size limit on the Email Security.cloud platform, you continue to receive bounce notifications or errors in Track and Trace referring to message size.
552 5.3.4 Message size exceeds fixed maximum message size
552 Message size exceeds fixed limit
Cause
Why did this happen? How can I fix it?
Many mail servers place a limit on the size of emails they will accept. For example, the default maximum message size for Microsoft Exchange is 10 MB. This value will prevent the delivery of larger emails regardless of the Maximum Email Size settings in the client portal.
In order to resolve this error, you will need to adjust the settings on your MTA (Mail Transfer Agent) or Transport Hub.
Microsoft Exchange users should see the Microsoft support article Message size limits in Exchange Server for assistance or contact your vendor.
For other MTAs, please refer to the support documentation provided by the vendor.
Resolution
How do I know an email was blocked by the Exchange Server and not the Email Security.cloud Maximum Email Size setting?
Emails rejected due to the Maximum Email Size setting will be clearly labeled «Email Size Limit» under the Service heading in the Track and Trace logs. In addition, in the Track and Trace detailed view there will be no Delivery section.
Emails that passed through our servers and reached the destination server will be populated with Deliver section along with the offending Recipient Server IP.
Emails blocked by Email Security.cloud Size Limit | Emails blocked by MTA size limit |
---|---|
Table 1: Emails blocked due to size limit in Track and Trace.
Additional Information
Are there alternative options so I don’t need to modify my server settings?
Yes. At its core, Email was originally designed for text and not transport of large files. Online storage lockers emerged to fill this requirement. Some notable services include, but are not limited to, Box, Dropbox, Google Drive and Microsoft OneDrive. Utilizing these storage solutions will allow the sharing of larger files without the need to modify size limit settings or place an extra workload the mail server.
Related Articles
https://docs.microsoft.com/en-us/exchange/mail-flow/message-size-limits
https://docs.microsoft.com/en-us/exchange/recipients/user-mailboxes/mailbox-message-size-limits
Feedback
thumb_up
Yes
thumb_down
No
I already edited the main.cf file like this:
message_size_limit = 25600000
service postfix restart
postconf message_size_limit
message_size_limit = 25600000
I tried to send a mail with 18GB of total attachments and the log still showed:
NOQUEUE: reject: MAIL
552 5.3.4 Message size exceeds fixed limit; proto=ESMTP
Does something else can cause this?
asked Mar 27, 2015 at 4:45
1
I needed an even bigger limit.
When sending an attachment, it’s first converted to text (MIME), which
causes it to be a bit larger… 25% — 33% larger, if I remember
correctly.
https://www.virtualmin.com/node/35034#comment-139301
answered Mar 27, 2015 at 5:01
givansegivanse
2103 silver badges11 bronze badges
message_size_limit is measured in bytes.
message_size_limit = 25600000
for 18GB, you need 3 additional zeroes to the number.
answered May 15 at 18:37
Gmail Help
Sign in
Google Help
- Help Center
- Community
- Gmail
- Privacy Policy
- Terms of Service
- Submit feedback
Send feedback on…
This help content & information
General Help Center experience
- Help Center
- Community
- New to integrated Gmail
Gmail
Stay on top of the new way to organize a space. Learn more about in-line threading.