procmail
[Top] [All Lists]

Re: How do I detect mail of inexistent receipient? (User slamming?)

2005-09-26 09:51:09
On Mon, Sep 26, 2005 at 10:18:58AM -0400, Eric Wood wrote:
I need to somehow test to To:,CC:, BCC: for the existence of a bad
recipient or some kind of "user-slamming" technique.

I can get my entire list of valid recipients from my system files by doing 
this:
$USERS=`cat passwd.interplas.com aliases.interplas.com | cut -f1 -d: | sort 
| uniq`

So if I have an email come in with:

To: eric(_at_)interplas(_dot_)com, erik(_at_)interplas(_dot_)com, 
erika(_at_)interplas(_dot_)com,
tom(_at_)xyz(_dot_)com, tommy(_at_)xyc(_dot_)com

I need that message to fail because erik and erika doesn't exist, yet the
message gets through to me, eric.

So I need some kind of loop to:
1. Eliminate all recipients except interplas.com people. So I end of with
eric, erik, and erika.
2. Test that all recipients belong in my $USERS list.

Much appreciated! Thanks!
-Eric Wood

You may want to play with
    grep -v -f users.file 
or
    
^TO_interplas\(_dot_)com[^(_at_)]*@interplas\(_dot_)com[^(_at_)]*@interplas\.com

-- 
William Park <opengeometry(_at_)yahoo(_dot_)ca>, Toronto, Canada
ThinFlash: Linux thin-client on USB key (flash) drive
           http://home.eol.ca/~parkw/thinflash.html
BashDiff: Super Bash shell
          http://freshmeat.net/projects/bashdiff/

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>