3

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!

Steffen Nielsen
  • 143
  • 1
  • 4

2 Answers2

5

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.

NickW
  • 10,183
  • 1
  • 18
  • 26
  • BTW, the time delay is up to you, if you're sending mail one at a time, you could probably reduce it, if you find it too slow. – NickW Feb 03 '14 at 10:16
  • Hi NickW. Your changes do have an effect on the delivery rate, which limits mails to be sent to the specified domains per X second. But this does not solve the problem as I guess the SMTP connection persists between each email. Is it somehow possible to: send email, close connection, start connection, send email...? – Steffen Nielsen Feb 03 '14 at 10:43
  • You may want to set this then : `http://www.postfix.org/postconf.5.html#smtp_connection_reuse_time_limit` maybe set it to 15 seconds, and up the `smtp-slowdelivery_destination_rate_delay =` to 20 seconds.. – NickW Feb 03 '14 at 10:48
  • Thank you NickW. This option along with your instructions seems to work for me. – Steffen Nielsen Feb 03 '14 at 13:03
  • It's a pity you have to jump through so many hoops for this guy.. at least postfix lets you make these changes. Glad I was able to help! – NickW Feb 03 '14 at 13:06
  • I believe there has to be an underscore between the transport name and the config paramter. For e.g. "smtp-slow_delivery_destination_recipient_limit " – James Wong Oct 13 '15 at 09:26
0

for anyone else looking at this, the below needs to be put in /etc/postfix/master.cf and not /etc/postfix/main.cf

this may have been obvious to others but for someone not as familiar with postfix this caused mail to sit in the queue

 smtp-slowdelivery       unix  -       -       n       -       -       smtp
 -o syslog_name=smtp-slowdelivery
scottmc
  • 11
  • 2
  • 1
    When you spot an error in a post you can suggest an edit to correct it. You even earn some reputation when the edit is accepted. There is no need to post an additional answer. – Gerald Schneider Apr 01 '22 at 05:42