At 08:52 2001-10-24 -0700, Don Caprio wrote:
I'm new to procmail so be gentile :^).
That's easy, I'm atheist.
(gentile != gentle)
I'm trying to cook a receipe that only
accepts email from my authorized list of addresses.
A "greenlist" (or less PC, "whitelist"). You should find a lot of useful
info on how to effectively do this by searching the list archives (see the
link from <http://www.procmail.org> for either of these terms, and possibly
"allow" as well.
I use an entirely different mechanism (in multiple invocations, for
different groups), which is basically:
:0:
* $? formail -xFrom: | grep -i -f $PMDIR/friends.dat
friends.mbx
This doesn't check the same headers as you do, but the principle is the
same. It also involves invocation of an external process (grep), which may
not be desireable for you. in the friends.dat file, I merely list
addresses on a line by line basis. Partial addresses work too.
In my receipe I have:
INCLUDERC=$PMDIR/authorized_addrs
REJFILE=$PMDIR/rejected_addrs
Why the different formatting (one as a file name reference, the other as an
include)? If you're going to INCLUDE the one, just to make it stand out as
procmail code, versus a raw address list, you might name it with the '.rc'
extension, or perhaps ".rci" for "rc, included" (this is not a standard,
nor required, but will help identify such files in the directory, which is
handy when things grow more complex).
* ^(From:|Sender:|Reply-To:)${AUTHLIST}
Even discounting your variable expansion problem, this won't match anyway
given the regexp which AUTHLIST would expand to -- you're not taking into
account leading whitespace or other symbols (addresses appearing in
brackets for instance). You probably want a '.*' before the variable...
AUTHLIST=('Don(_dot_)Caprio(_at_)bankofamerica(_dot_)com|caprio|bankamerica.com|bankofamerica.com|dcms.com|uxpro.com|Caprio|Don')
This doesn't agree with what you're stating in your log - and if you change
things, often the nature of the problem changes too. Also, various
components there are redundant (less so in the logfile excerpt, but
"caprio" and "Caprio" will evaluate the same since procmail is case
insensitive unless told otherwise).
procmail: Assigning
"AUTHLIST=(*(_at_)bankofamerica\(_dot_)com|caprio|*dcms\.com|*uxpro\.co
m|Caprio|Don)"
Looking a the log it looks like the AUTHLIST variable doesn't get
expanded (No match on "^(From:|Sender:|Reply-To:)${AUTHLIST}").
* $^(From|Sender|Reply-To):.*$AUTHLIST
(note also that the colon, which is common to all three headers, has been
externalized to the OR condition - no need to duplicate it several times)
---
Sean B. Straw / Professional Software Engineering
Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
Please DO NOT carbon me on list replies. I'll get my copy from the list.
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail