I have a postfix mail server and I want to override an MX value for a particular domain.

From my understanding this is can be done by the use of transport_maps


You add a line to /etc/postfix/transport:

example.com smtp:[]

Generate a postmap file using:

postmap hash:/etc/postfix/transport

add or edit a line in /etc/postfix/main.cf:

transport_maps = hash:/etc/postfix/transport

Restart Postfix

The question I have is when normally using MX address you normally have multiple mail servers for redundancy (in case one go's off line) How can I achieve the same thing with a transport map as it seems to point to a single ip address. Is there any way to set so that it would try multiple ip addresses in the case the first one failed.

2 Answers 2


as far as I can tell the SMTP transport doesn't do that. however you can set a dummy dns domain with MX records pointing to the hosts you want to relay mails to and use it in your transport map without squared brackets:

dest.example.com smtp:dummy.example.net

starting from Postfix >= 3.5 one can write in the transport file

example.com      smtp:bar.example, foo.example

so if bar.example do not reply foo.example will be used.

NB: postmap real syntax is postmap /etc/postfix/transport

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.