procmail
[Top] [All Lists]

Re: procmail blues: grepping from /etc/passwd for "SEND" users...

2002-12-28 13:20:23
I'm horrific with regular expressions and all that sort of thing, I'm
getting the above to match poff(_at_)sixbit(_dot_)org to po or the first 2 
characters
of an address...

That should actually be a .* at the end, not just a dot - typo on my part.

Works great! I was always trying to figure out how to kill whitespace on
the "from" tag as it wouldn't match otherwise.

I have another problem...

Part of my "pattern matching" for grabbing a user on this system is:

:0:
* egrep -i "${FROM}" .sdfers
"sdf'ers"

HOWEVER this does "exact" matches on the .sdfers file, for example:

FROM=poff(_at_)sixbit(_dot_)org
in .sdfers has to be a value poff(_at_)sixbit(_dot_)org or it won't match.

I really wanted partial matches like, matches a domain:

echo "derek(_at_)sixbit(_dot_)org" | egrep -if .sdfers

Since "sixbit.org" is in the .sdfers this matches; however the previous
method doesn't match :(

Is there a better way where I can have, a recipe for matching domains
(this system users can use about 13 different domains) and THEN a separate
recipe for people who aren't on those domains but whom I know...?

I don't know why this new recipe doesn't work whereas the old one appeared
to... something to do with the order of the "regular expression" in
question.

Hmm I getting a *little* less confused... but maybe I'll start it ALL over
again once I've cleared up this grep problewm. And yes, what exactly is
the diff. between grep and egrep?

Thanks for your help,

poff(_at_)sixbit(_dot_)org
SDF Public Access UNIX System - http://sdf.lonestar.org


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail