Postfix Dedicated Transport Howto

Synopsis

The scenario for this postfix dedicated transport example is a need to reduce the MTA's SMTP client delivery concurrency to a specific host as said host, example.org, is rejecting delivery of concurrent messages possibly due to UCE countermeasures. We only need to throttle delivery concurrency for this particular host and possibly other hosts in the future while maintaining the default concurrency limit for all other hosts that are relayed to.

To utilize per-transport postfix configuration parameters for specific hosts a "dedicated transport" needs to be implemented as outlined below.

  1. Define an additional smtp transport in master.cf
  2. Create the transport map file
  3. Configure main.cf to utilize transport map
  4. Configure per-transport parameters in main.cf
  5. Reload postfix

Implementation

Define additional smtp transport

The postfix master.cf file is where the new "slow" dedicated transport will be defined. Edit master.cf to use the same variables for "slow" as are currently working for the existing "smtp" transport, do not copy the example below verbatim as your existing "smtp" transport may very well use different parameters. Please take note that "smtp" and "smtpd" in the command column are two totally different commands and you want to duplicate your existing "smtp" client entry *not* the "smtpd" server. This is a very common mistake, reread the previous sentence to ensure you understand the difference.

One specific change for this new dedicated transport is the "maxproc" field value has been set to 1 instead of the default:

/etc/postfix/master.cf
#==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
#==========================================================================
slow      unix  -       -       N       -       1       smtp

Create transport map file

The transport map file contains a list of hosts and the transport to use when delivering mail to those hosts. It's possible to do quite a bit more with transports, see "man 5 transport" for more options. The following transport map will cause all mail destined for example.org to be relayed by the "slow" transport:

/etc/postfix/transport
example.org      slow:

Build the transport map .db hash table with postmap.

# postmap /etc/postfix/transport

Additional hosts can be added to the transport map as required. Remember to postmap the transport file after every update.

Configure main.cf to utilize transport map

Edit main.cf and add or edit the transport maps configuration parameter to have postfix utilize the new transport(5) map.

/etc/postfix/main.cf
transport_maps = hash:/etc/postfix/transport

Configure per-transport parameters

Configure per-transport parameters in main.cf for the slow transport by prefixing the transport service name for any configuration parameters that are specific for the new slow dedicated transport:

/etc/postfix/main.cf
slow_destination_recipient_limit = 20
slow_destination_concurrency_limit = 2

Setting any transports destination_recipient_limit parameter to a value of 1 changes the meaning of the corresponding per-destination_concurrency_limit from concurrency per domain into concurrency per recipient, which may in fact be what you require. You'll have to adjust the parameter values until you find what is acceptable by the remote host.

Reload postfix

Reload postfix to apply the new transport

# postfix reload

Check the postfix server mail logs to ensure the new dedicated transport is working as expected.

Create date: 10/04/2008
Last update: 11/17/2014

David B. Ferguson <dferguson@linuxnet.ca>