postfix smtp_fallback_relay for deferred messages to a single domain
Posted
by
EdwardTeach
on Server Fault
See other posts from Server Fault
or by EdwardTeach
Published on 2012-11-28T00:26:25Z
Indexed on
2012/11/28
17:07 UTC
Read the original article
Hit count: 318
postfix
I use Postfix to send messages to a mail server outside my organization which frequently rejects/defers my mail. My Postfix server sees that these messages are deferred and tries again, eventually getting through. Final delivery can take up to an hour, which makes my users unhappy. In comparison, mail from my Postfix server to other hosts works normally.
I have now found out about a second, unofficial MX for this domain that does not reject/defer mail. This second MX does not appear when doing a DNS MX query for the domain. Therefore, for the problem domain I would like to use this second MX as a fallback. That is: whenever mail is deferred by the primary MX, try again on the unofficial second MX.
I see that there is already a postfix configuration "smtp_fallback_relay". However the documentation seems to indicate that I can not restrict usage of the fallback to a single domain. The documentation also doesn't mention deferred message handling.
So is there a way to configure a single-domain, deferred-retry fallback host in Postfix?
For reference, I am including my postconf output (the host names and ip addresses are fake):
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases, hash:/etc/postfix/legacy_mailman, ldap:/etc/postfix/ldap-aliases.cf
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
default_destination_concurrency_limit = 2
inet_interfaces = all
inet_protocols = all
local_destination_concurrency_limit = 2
local_recipient_maps = $alias_maps
mailbox_size_limit = 0
mydestination = myhost.my.network, localhost.my.network, localhost, my.network
myhostname = myhost.my.network
mynetworks = 127.0.0.0/8, [::ffff:127.0.0.0]/104, [::1]/128, 10.10.10.0/24
myorigin = my.network
readme_directory = no
recipient_delimiter = +
relay_domains = $mydestination
relayhost =
smtp_fallback_relay = the.problem.host
smtp_header_checks =
smtpd_banner = $myhostname ESMTP $mail_name
virtual_alias_maps = hash:/etc/postfix/virtual
© Server Fault or respective owner