I think I've diagnosed a problem with my Postfix mail server, now I just need help implementing the fix.
I am a "league member" at a sports website with 11 other people and when someone makes a post on said website, it sends a notification email to all members. I have not received any of these emails for 2+ years now, so I decided to investigate and this is what I found.
The message in my mail.log is:
Mar 29 12:26:51 mymailserver postfix/pipe[12545]: 669553800406: to=<[email protected]>, relay=dovecot, delay=0.41, delays=0.35/0/0/0.06, dsn=5.4.6, status=bounced (mail forwarding loop for [email protected])
So after a lot of searching and not much success, there are two obscure pages online that mention this behavior in my context.
You mail is bounced because it contains a Delivered-To: header with the address of the recipient.
In order to avoid the loop issue you have to enable in /etc/postfix/main.cf the following statement. header_checks = regexp:/etc/postfix/header_checks Then, add the following line in /etc/postfix/header_checks /^Delivered-To: .*/ IGNORE Then, rebuild the hash table and reload the postfix configuration: [snip]
So I temporarily changed my email address at the website in question to a throwaway gmail account and made a post on the website so I could see the headers, and they do appear to include an extra Delivered-To
header before my Postfix has had a chance to add it's own, thus causing the forwarding loop. Headers here at pastebin.com, the extra header is on line 47.
First question, do you think the extra Delivered-To
header is the reason for the mail forwarding loop?
If so, the article at howtoforge.com above has instructions for a fix, but I'm wondering if there is a better way? It seems a little hacky to me, and also seems like every guide online would include this info given it should be included on every installation.
The howtoforge.com fix would look like this in my environment:
# vim /etc/postfix/main.cf
> header_checks = regexp:/etc/postfix/header_checks
# vim /etc/postfix/header_checks
> /^Delivered-To:.*/ IGNORE
# postmap /etc/postfix/header_checks
# service postfix restart
# service postfix status
If that's not the correct fix, I'd be open to any and all suggestions.