I'm trying to configure my postfix (2.9.6) mail server to initially try deliver messages directly to the recipient MX, then fall back to relaying through my ISP's mail server if it recieves a 5xx status code. My mail server is on the end of a home broadband connection so it falls foul of spamhaus filtering. I'm aware that I could relay everything through my ISP's server, but I'd rather not unless it is absolutely necessary. Call me paranoid.

I was hoping that something like this in main.cf would do the job (port 11125 is an stunnel to my ISP's mail relay, and does work if I set it as the relayhost)

relayhost =
smtp_skip_5xx_greeting = yes
smtp_fallback_relay = []:11125

That just bounces though, eg

Nov 19 12:46:15 mail-server postfix/smtp[14459]: E9275744: to=<test@hotmail.co.uk>, relay=mx2.hotmail.com[]:25, delay=1.3, delays=0.04/0.01/0.46/0.81, dsn=5.0.0, status=bounced (host mx2.hotmail.com[] said: 550 OU-002 (SNT0-MC1-F51) Unfortunately, messages from xx.xx.xx.xx weren't sent. Please contact your Internet service provider since part of their network is on our block list. You can also refer your provider to http://mail.live.com/mail/troubleshooting.aspx#errors. (in reply to end of DATA command))

So, is it possible to have postfix attempt to deliver via a fallback relay in the face of such a message?

closed as off-topic by Jenny D, voretaq7 Nov 19 '13 at 19:07

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is dedicated to professional system and network administrators. End user and enthusiast questions are off-topic (contact your system administrator or hire a professional to help you out). Please see the Help Center for more information." – Jenny D, voretaq7
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    even if that was possible (which I don't think, but I'm not sure) i wouldn't recommend it. Re-sending every hard-bounced mail doesn't make any sense. Many (I'd say most) professional MTAs will not accept mail from a home ip range, so most of your mail would be sent through your ISP's MTA anyway. You'd probably be better off setting up a trusted mail relay on a non-residential IP – Gryphius Nov 19 '13 at 15:18
  • 2
    This is not really off-topic and is actually a thing out in the wild. It's a problem for businesses warming up new server IPs. Initially, your server's IP will likely have deliverability problems so, while it's reputation is building, you still need to get mail delivered. But if you don't send from your new IP it'll never build it's reputation. I have basically the same question over here: serverfault.com/questions/838289/… – Shovas Mar 16 '17 at 15:23

There's no such option in the config. You might possibly do something creative with piping bounces through a script that adds the target domain to a transport table and re-sends the email. But I'd advise you to either get a server from a colo provider who isn't spam-infested enough to get added to blacklists, or to simply use your ISP:s server.

  • There may now be a method of doing this by using the soft_bounce=yes conf param. We're working on that over here since it is a legitimate concern for warming up new server IPs since their sender reputation can be low or even negative when you get a hold of a new server: serverfault.com/questions/838289/… – Shovas Mar 22 '17 at 14:17

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