Tunning de parámetros de Postfix

Daniel Eugenin M. -

Por defecto, postfix (de Zimbra) viene con los siguientes valores por defecto:

anvil_rate_time_unit = 60s                           <- unidad de tiempo definida por postfix 
smtpd_client_message_rate_limit = 0       <- ilimitados mensajes que pueden enviar los usuarios por unidad de tiempo 
smtpd_client_recipient_rate_limit = 0        <- número ilimitado de destinatarios de correo en un mensaje 

 

 * Nota: todos estos parámetros son aplicables a todos los correos (enviados/recibidos), no pudiendo hacer una distinción ni por usuario ni por dominio.


1) Restricciones de envío/recibo de correos:

Por ejemplo, si se quiere limitar a un máximo de 5 correos por minuto.

 En caliente:

#postconf -e anvil_rate_time_unit=60s
#postconf -e smtpd_client_message_rate_limit=5

 

En Zimbra:

Editar /opt/zimbra/postfix/conf/main.cf, y agregar al final:

smtpd_client_message_rate_limit = 5

Luego, reinicar servicio mta:

#zmmtactl restart

 

 

 

2) Restricciones de número de destinatarios en un correo:

 Por ejemplo, si se quiere limitar a un máximo de 20 destinatarios por cada correo:

En caliente:

#postconf -e smtpd_client_recipient_rate_limit=20

 

En Zimbra:

Editar /opt/zimbra/postfix/conf/main.cf, y agregar al final:

smtpd_client_recipient_rate_limit = 20

Luego, reinicar servicio mta:

#zmmtactl restart

 

 

 

3) Tiempo máximo de permanencia de correos en la cola:

 Por defecto, el tiempo de permanencia de los correos que están en la cola de Postfix es de 5 días. Pasados estos 5 días, si el correo no es posible despacharlo por (cualquier razón), el correo es eliminado de la cola.

 Los parámetros que mantienen esto es bounce_queue_lifetime (MAILER-DAEMON) y maximal_queue_lifetime

 Por ejemplo, si se quiere bajar este tiempo y que los correos se eliminen de la cola después de 3 días de intentos:

En caliente:

#postconf -e bounce_queue_lifetime=3d
#postconf -e maximal_queue_lifetime=3d 

 

En Zimbra:

Editar /opt/zimbra/postfix/conf/main.cf, y agregar al final:

bounce_queue_lifetime = 3d
maximal_queue_lifetime = 3d 

O, ejecutar (como usuario zimbra):

zmlocalconfig  -e "postfix_bounce_queue_lifetime=3d"

Luego, reinicar servicio mta:

#zmmtactl restart

 

 

Documentación

 

anvil_rate_time_unit (default: 60s)

The time unit over which client connection rates and other rates are calculated.

This feature is implemented by the anvil(8) service which is available in Postfix version 2.2 and later.

The default interval is relatively short. Because of the high frequency of updates, the anvil(8) server uses volatile memory only. Thus, information is lost whenever the process terminates.

Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds).

 

 

smtpd_client_message_rate_limit (default: 0)

The maximal number of message delivery requests that any client is allowed to make to this service per time unit, regardless of whether or not Postfix actually accepts those messages. The time unit is specified with the anvil_rate_time_unit configuration parameter.

By default, a client can send as many message delivery requests per time unit as Postfix can accept.

To disable this feature, specify a limit of 0.

WARNING: The purpose of this feature is to limit abuse. It must not be used to regulate legitimate mail traffic.

This feature is available in Postfix 2.2 and later.

Example:

smtpd_client_message_rate_limit = 1000


smtpd_client_recipient_rate_limit (default: 0)

The maximal number of recipient addresses that any client is allowed to send to this service per time unit, regardless of whether or not Postfix actually accepts those recipients. The time unit is specified with the anvil_rate_time_unit configuration parameter.

By default, a client can send as many recipient addresses per time unit as Postfix can accept.

To disable this feature, specify a limit of 0.

WARNING: The purpose of this feature is to limit abuse. It must not be used to regulate legitimate mail traffic.

This feature is available in Postfix 2.2 and later.

Example:

smtpd_client_recipient_rate_limit = 1000


bounce_queue_lifetime (default: 5d)

The maximal time a bounce message is queued before it is considered undeliverable. By default, this is the same as the queue life time for regular mail.

Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is d (days).

Specify 0 when mail delivery should be tried only once.

This feature is available in Postfix 2.1 and later.

 

 

 Referencias:

http://www.postfix.org/postconf.5.html

http://www.postfix.org/TUNING_README.html

 

 

0 Comentarios

Inicie sesión para dejar un comentario.
Tecnología de Zendesk