diff --git a/cmdeploy/src/cmdeploy/postfix/main.cf.j2 b/cmdeploy/src/cmdeploy/postfix/main.cf.j2 index 6f88277c..9ec9f039 100644 --- a/cmdeploy/src/cmdeploy/postfix/main.cf.j2 +++ b/cmdeploy/src/cmdeploy/postfix/main.cf.j2 @@ -102,6 +102,18 @@ smtpd_peername_lookup = no # so instead this is handled in filtermail. # We use LMTP instead SMTP so we can communicate per-recipient errors back to postfix. default_transport = lmtp-filtermail:inet:[127.0.0.1]:{{ config.filtermail_lmtp_port_transport }} + +# All deliveries over lmtp-filtermail are treated +# as having the same destination [127.0.0.1], +# so it is not possible to limit per-destination concurrency here, +# it is a job for filtermail-transport. +# Total number of parallel deliveries is limited +# by "maxproc" column in /etc/postfix/master.cf for lmtp-filtermail. +# Settings below are to prevent Postfix queue manager +# from limiting the number of LMTP connections to filtermail-transport. +# Read and +# for the details +# of the Postfix algorithm that we effectively disable here. lmtp-filtermail_initial_destination_concurrency=10000 lmtp-filtermail_destination_concurrency_limit=10000 diff --git a/cmdeploy/src/cmdeploy/postfix/master.cf.j2 b/cmdeploy/src/cmdeploy/postfix/master.cf.j2 index 84c17413..f704c96c 100644 --- a/cmdeploy/src/cmdeploy/postfix/master.cf.j2 +++ b/cmdeploy/src/cmdeploy/postfix/master.cf.j2 @@ -105,7 +105,15 @@ filter unix - n n - - lmtp authclean unix n - - - 0 cleanup -o header_checks=regexp:/etc/postfix/submission_header_cleanup -lmtp-filtermail unix - - y - 10000 lmtp +# Reducing `maxproc` here may result in a head of line blocking +# when there are many messages sent to unreachable destinations +# at the same time. +# LMTP clients here talk to filtermail-transport. +# LMTP has no pipelining, +# so while filtermail-transport tries to deliver the message, +# possibly waiting for a long connection timeout +# or talking to a slow server, LMTP client cannot be reused. +lmtp-filtermail unix - - y - 1000 lmtp -o syslog_name=postfix/lmtp-filtermail -o lmtp_header_checks= -o lmtp_tls_security_level=none