Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
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 6:28
    
Hopefully the application that generated them can resend them.. –  NickW Dec 20 '13 at 9: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 6:45

1 Answer 1

up vote 1 down vote accepted

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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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