Sometimes you have to set specific postfix variables for specific hosts because those hosts are too slow to deal with your extremely powerful server, like ours which can destroy a galaxy with one email, all hail our mailserver! (please don't crush me!).

There are a number of other reasons why you might need to do this, and other configurations that you can specify for specific servers, but this example revolves around Humboldt State and their mailserver which buckled under our default postfix configuration that is able to send email to every other mailserver out there without problems. So here I detail how to setup a dedicated transport, and how to set specific postfix configuration variables for that transport, by using the tweaks that we made in order to slow down delivery and increase the number of recipients per envelope.

Creating a dedicated transport

To set specific postfix configuration variables for specific hosts, you have to configure a "dedicated transport", to do this you need to have the following configured:

The main postfix configuration needs to be setup to use transports and be told where the transport map is and how it is hashed:

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

The transport map contains a list of hosts and the transport to use when sending mail to those hosts (it is possible to do quite a bit more with the transport file, see the man page at the top, or "man 5 transport" for other options), here we set all mail for foo.org to go through the "slow" transport:

/etc/postfix/transport:
foo.org slow:

In postfix's master.cf file we detail how the "slow" transport works. In this setup, I have used the same variables for "slow" as are currently working for the existing "smtp" transport (NB: "smtp" and "smtpd" are different!), with one specific change for this scenerio, the "maxproc" variable is set to 1, instead of the default (50):

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

Anything destined for foo.org will use slow: which is defined in master.cf as a smtp transport.

To set specific configurations for slow you do so in your normal /etc/postfix/main.cf by prepending the transport in front of any configuration variables that are specific for the transport:

slow_destination_recipient_limit = 100
slow_destination_concurrency_limit = 2

Once all of this is setup, you need to build the transport map and reload postfix to take the configuration changes:

# postmap /etc/postfix/transport
# postfix reload

all done... be sure to watch your logs to see if the transport is working according to how you expect it to.