On 11/13/2013 2:34 AM, naser sonbaty wrote:
> Hi,
> 
> I need help with postfix regexp in header_checks.
> I want discard all emails(any domain) from admin@
> 
> I use following:
> /^(To|From|Cc|Reply-To): admin@(.*)/        DISCARD
> 
> but its not working

Tests fine here:

$ cat test.regexp
/^(To|From|Cc|Reply-To): admin@(.*)/        DISCARD

$ postmap -q "blah: ad...@abc.com" regexp:./test.regexp

$ postmap -q "From: ad...@abc.com" regexp:./test.regexp
DISCARD

$ postmap -q "To: ad...@abc.com" regexp:./test.regexp
DISCARD

$ postmap -q "CC: ad...@abc.com" regexp:./test.regexp
DISCARD

$ postmap -q "Reply-To: ad...@abc.com" regexp:./test.regexp
DISCARD

If these tests work but header_checks isn't working then you need to
execute "postfix reload" to load your new/modified regexp table.

Also, note that the carat (^) anchor isn't necessary.  The header fields
you're testing for are in the left most position.  Thus no reason to
left anchor your expression.

-- 
Stan

Reply via email to