3

I had a number of messages get rejected by the recipient's mail server with a status 550 code due to an IP address blacklist. I've sorted the problem that caused the host to become blacklisted, and removed the entry from the blacklist.

I'd like to have Postfix resend the messages that failed (they're automated code-review e-mails for the development team, so somewhat important). Is this possible, and if so, what's the best approach? If Postfix can't be made to automatically resend these messages, is there at least a way to recover them so that they can be manually resent?

aroth
  • 393
  • 3
  • 9
  • 1
    hard bounces are returned to the sender and removed from the postfix queue immediately. there is no way to resend (unless your sending application keeps a copy of all sent messages) – Gryphius Dec 20 '13 at 06:28
  • Hopefully the application that generated them can resend them.. – NickW Dec 20 '13 at 09:57
  • @NickW - Yep, that's basically what I ended up doing. Luckily only a couple dozen commits were lost, so I manually replayed the post-commit hook for those revision numbers, which sent out fresh copies of the e-mails. Problem solved. At least, kind of. – aroth Dec 21 '13 at 06:45

1 Answers1

3

You can use smtp_reply_filter feature to transform hard reject to soft reject when sending email. The idea was given by this thread.

In main.cf, add this line

smtp_reply_maps = pcre:/etc/postfix/smtp_5xx_to_4xx

and in /etc/postfix/smtp_5xx_to_4xx, add the line

if !/^5[0-9][0-9][ -]5\.1\.[0-9] /
    /^5(.*)$/ 4$1
endif
masegaloeh
  • 17,978
  • 9
  • 56
  • 104