Postfix deliveries per connection

connectionpostfixsessionsmtp

hope you can assist me in this case.

I am administrating an Postfix server which is used for newsletters. Recently one of the major recipient domains changed their policies to only accept one email per smtp session/connection. To adhere to their policy I found the following settings in main.cf to be kind of useful as they refer to concurrency of email delivery, though it doesn't seem to help.

(I've tested with values as low as 1)

  • initial_destination_concurrency
  • default_destination_concurrency_limit
  • smtp_destination_concurrency_limit

The error I am facing is: dsn=4.4.2, status=deferred, along with a link telling me to send a single email per SMTP connection.

Postfix version: 2.9.6

Any suggestions will be appreciated!

Best Answer

If you're faced with a specific domain asking for slower delivery, the easiest way is to set up a custom transport:

In /etc/postfix/main.cf place these two lines (name it what you want, just use it consistently):

smtp-slowdelivery       unix  -       -       n       -       -       smtp
-o syslog_name=smtp-slowdelivery

In /etc/postfix/main.cf add these lines:

smtp-slowdelivery_destination_rate_delay = 12s
smtp-slowdelivery_destination_concurrency_limit = 1
smtp-slowdelivery_destination_recipient_limit = 1
smtp-slowdelivery_initial_destination_concurrency=1

Add this to /etc/postfix/transport (which you may need to create)

/\@thatdomain.com$/ smtp-slowdelivery:

(replace thatdomain with the domain you need to slow deliveries to)

Postmap the file postmap /etc/postfix/transport

then tell postfix the file is a regex:

in /etc/postfix/main.cf add:

transport_maps = regexp:/etc/postfix/transport

and then run postfix reload

You should then see mail sent though your new transport in your maillog.