Hi, I have configured postfix to DISCARD messages with specific To: header using the rule below : -
header_checks=pcre:/etc/postfix/header_checks cat /etc/postfix/header_checks : /^To: (\d)+@test\.com/i DISCARD So basically any email sent as num...@test.com should be discarded. However this rule doesn't work seen from logs : - Jul 25 11:22:03 mailhost postfix/smtpd[1134]: 3D67AD763D: client=test.com [10.117.82.152] Jul 25 11:22:03 mailhost postfix/cleanup[1138]: 3D67AD763D: message-id=< 576774775.0.1311573122768.javamail.r...@test.com> Jul 25 11:22:03 mailhost postfix/qmgr[29582]: 3D67AD763D: from=< ad...@test.com>, size=617, nrcpt=1 (queue active) Jul 25 11:22:03 mailhost postfix/smtpd[1134]: disconnect from test.com [10.117.82.152] Jul 25 11:22:03 mailhost amavis[28069]: (28069-01) ESMTP::10024 /usr/local/amavis/tmp/amavis-20110725T112203-28069: <ad...@test.com> -> < 919923600...@test.com> SIZE=617 Received: from test.com ([127.0.0.1]) by localhost (test.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP for < 919923600...@test.com>; Mon, 25 Jul 2011 11:22:03 +0530 (IST) Jul 25 11:22:03 mailhost amavis[28069]: (28069-01) Checking: rsPpnJ-irXBH MYNETS [10.117.82.152] <ad...@test.com> -> <919923600...@test.com> Jul 25 11:22:08 mailhost postfix/smtpd[1178]: connect from localhost.localdomain[127.0.0.1] Jul 25 11:22:08 mailhost postfix/smtpd[1178]: 0A369D765F: client=localhost.localdomain[127.0.0.1] Jul 25 11:22:08 mailhost postfix/cleanup[1138]: 0A369D765F: message-id=< 576774775.0.1311573122768.javamail.r...@test.com> Jul 25 11:22:08 mailhost amavis[28069]: (28069-01) FWD via SMTP: < ad...@test.com> -> <919923600...@test.com>,BODY=7BIT 250 2.0.0 Ok, id=28069-01, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 0A369D765F Is this because I have webmail running on same server and mynetworks have 127.0.0.0/8 10.117.82.152 ? I am out of ideas and tried all things even :- /^To: .*/i DISCARD but nothing seems to be working. Any advice on what could be wrong ? Regards, Punit