On 3/31/2017 3:50 PM, John Stoffel wrote: > So I created the following entry in my header_checks file: > > /^Delivered-To:/ WARN Found email with Delivered-To: header already in it! > > And while it did correctly warn on a bogus email that matched with > looping, it also matched on a bunch of other emails, which didn't get > rejected for looping.
Postfix bounces mail when the Delivered-To address is the same as the current recipient. > > So I'm wondering if the problem is that I'm not accepting email for my > legacy "foo.com" domain properly, while I am accepting email for my > "foo.bar.com" domain that we're now supposed to be using for all > email. > The easiest explanation is that you are accepting mail for the old domain, then forwarding it through outlook back to the new domain. Or something similar. > I'm glad I just did a warning match at first, instead of holding all > these emails, because it would have been a disaster for a bit until I > figured it out. Is there anyway, besides the hold queue to just log > all the headers of these messages so I can try to understand the issue > in more detail? To log all headers, use a header_check like: /./ info NOTE: postfix only allows one header_check rule per header, so this will disable any header_checks below it. Usually people put a log-all rule like this at the end of header_checks file. > I suspect that part of the problem is that we use > this server for outgoing emails, but all incoming from the internet > arrives through *.outbound.protection.outlook.com, so maybe they do > something to the headers? Test; don't speculate. As a bystander, my job it to speculate: I don't think outlook is adding the offending headers. -- Noel Jones > > My logs show the following: > > Mar 31 09:34:10 mailhost postfix/smtpd[28317]: connect from > mail-sn1nam01lp0113.outbound.protection. > outlook.com[207.46.163.113] > Mar 31 09:34:10 mailhost postfix/smtpd[28317]: 7B6D1A05FE: > client=mail-sn1nam01lp0113.outbound.prote > ction.outlook.com[207.46.163.113] > Mar 31 09:34:10 mailhost postfix/cleanup[28211]: 7B6D1A05FE: warning: > header Delivered-To: j...@foo.com from > mail-sn1nam01lp0113.outbound.protection.outlook.com[207.46.163.113]; > from=<ebayde...@e.deals.ebay.com> to=<j...@foo.com> proto=ESMTP > helo=<NAM01-SN1-obe.outbound.protection.outlook.com>: Found email with > Delivered-To: header already in it! > Mar 31 09:34:10 mailhost postfix/cleanup[28211]: 7B6D1A05FE: > message-id=<ebaydeals.6k01g03n-r.f...@e.deals.ebay.com> > Mar 31 09:34:10 mailhost postfix/qmgr[27314]: 7B6D1A05FE: > from=<ebayde...@e.deals.ebay.com>, size=62180, nrcpt=1 (queue active) > Mar 31 09:34:10 mailhost postfix/local[28017]: 7B6D1A05FE: > to=<j...@foo.com>, relay=local, delay=0.33, delays=0.28/0/0/0.05, dsn=5.4.6, > status=bounced (mail forwarding loop for j...@foo.com) > Mar 31 09:34:10 mailhost postfix/bounce[28363]: 7B6D1A05FE: sender > non-delivery notification: CCEC5A074E > Mar 31 09:34:10 mailhost postfix/qmgr[27314]: 7B6D1A05FE: removed > > > So I'm matching things... but I'm also matching on alot of other emails which > the logs look like this: > > > Mar 31 09:36:21 mailhost postfix/smtpd[28317]: connect from > hdqmta.foo.com[192.168.172.13] > Mar 31 09:36:21 mailhost postfix/smtpd[28317]: E08F2A07A4: > client=hdqmta.foo.com[192.168.172.13] > Mar 31 09:36:21 mailhost postfix/cleanup[28191]: E08F2A07A4: warning: > header Delivered-To: foo...@foo.bar.com from hdqmta.foo.com[192.168.172.13]; > from=<ftp...@fovm0026.iss.bar.co.jp> to=<foo-erpsupp...@bar.com> proto=ESMTP > helo=<hdqmta.foo.bar.com>: Found email with Delivered-To: header already in > it! > Mar 31 09:36:21 mailhost postfix/cleanup[28191]: E08F2A07A4: > message-id=<201703311636.v2vgahrb028...@fovm0026.iss.bar.co.jp> > Mar 31 09:36:21 mailhost postfix/qmgr[27314]: E08F2A07A4: > from=<ftp...@fovm0026.iss.bar.co.jp>, size=7014, nrcpt=1 (queue active) > Mar 31 09:36:21 mailhost postfix/smtpd[28317]: disconnect from > hdqmta.foo.com[192.168.172.13] > Mar 31 09:36:22 mailhost postfix/smtp[28312]: E08F2A07A4: > to=<foo-erpsupp...@bar.com>, relay=smtp.na.bar.local[192.168.64.152]:25, > delay=0.19, delays=0.01/0/0/0.18, dsn=2.6.0, status=sent (250 2.6.0 > <201703311636.v2vgahrb028...@fovm0026.iss.bar.co.jp> > [InternalId=91027536871548, Hostname=NA-EXMB-P20.NA.BAR.LOCAL] Queued mail > for delivery) > Mar 31 09:36:22 mailhost postfix/qmgr[27314]: E08F2A07A4: removed >