postfix-users October 2010 archive
Main Archive Page > Month Archives  > postfix-users archives
postfix-users: Re: problem blocking sender_address

Re: problem blocking sender_address

From: Ralf Hildebrandt <Ralf.Hildebrandt_at_nospam>
Date: Mon Oct 04 2010 - 12:11:13 GMT
To: postfix-users@postfix.org

* Tom Kinghorn <thomas.kinghorn@gmail.com>:
> Good afternoon list.
>
> I apologise for this post.

Hey, let's read your post first and decide later if you need to
apologize :)
 
> I am new to postfix and battling to block a sender who keeps changing
> digits in the sending address.

This sounds like a job for regex: or PCRE:

> I would like to block the sender using the regex
> westcoast[0-9]{3}@gmail.com (to block sender address of
> westcoast269@gmail.com etc..).

Yep.

/^westcoast[0-9]{3}@gmail\.com$/ REJECT

> However, adding it to the smtpd_sender_restrictions is not working
>
> config looks like:
>
> smtpd_sender_restrictions =
> <snip>
> check_sender_access regexp:/etc/postfix/sender_access_blacklist_regexp,
> </snip>
>
>
> sender_access_blacklist_regexp contains:
>
> #discard westcoast spammer
> westcoast[0-9]{3}@gmail.com DISCARD

/^westcoast[0-9]{3}@gmail\.com$/ DISCARD
or
/^westcoast[0-9]{3}@gmail\.com$/ REJECT

You're lacking the //

-- Ralf Hildebrandt Geschäftsbereich IT | Abteilung Netzwerk Charité - Universitätsmedizin Berlin Campus Benjamin Franklin Hindenburgdamm 30 | D-12203 Berlin Tel. +49 30 450 570 155 | Fax: +49 30 450 570 962 ralf.hildebrandt_at_charite.de | http://www.charite.de