0

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.

  1. postfix.nabble.com

You mail is bounced because it contains a Delivered-To: header with the address of the recipient.

  1. howtoforge.com

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.

1 Answer 1

3

I have confirmed that the howtoforge.com code above is the solution to my problem. It's important to remove the space in the file header_checks between the : and the .*, unlike what is shown on howtoforge.com (code fixed above).

Given that many people have probably followed the same Postfix/Dovecot setup tutorials I did and none of them include these settings, I imagine this post will help a few people down the road, but not many. Very few people will ever know they even have this config problem because almost nobody includes a Delivered-To header in their outgoing mail. But a few large corporate entities still do (CBS Sports), so I hope this helps someone.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .