procmail
[Top] [All Lists]

Re: help for a newbie

2004-11-28 17:28:17
On Mon, Nov 29, 2004 at 09:06:45AM +1000, Troy Piggins wrote:
* ^From:.*\/[A-Za-z0-9_(_dot_)+-]+(_at_)[A-Za-z0-9_(_dot_)+-]+
* ? grep -i "$MATCH" $WHITELIST
$WHITE

So your whitelist can be the aliases file type format, or just a
list of addresses.

Bad idea, I'm afraid, Troy.  Moreover, we've discussed this about
three or four times in the last couple of months, so we're really just
treading water here.

With only an -i option to grep, you will over-match when you don't
want to.  Here's an example:

 1:11am [~/Mail] 510[127]> awk -F: '{ print $1 }' /etc/passwd | grep -ci 
$LOGNAME 
10


Nine other people with accounts at my ISP would be let in if I were just 
trying to whitelist on my own name.

(I'd like to just print all the names, but it seems like a mild invasion
of privacy.  Yet you can well imagine what names "dman" might be part of.
Here's more of an idea:

 1:15am [~/Mail] 520[0]> grep -c dman /usr/share/dict/words
69

 1:15am [~/Mail] 521[0]> grep dman /usr/share/dict/words | head
adman
backswordman
bandman
beadman
bedman
birdman
boardman
bondman
bondmanship
breadman

You want at least a -w option to a whitelist file-grep, and ideally
a -w; and you want to use fgrep if you can to avoid unexpected
regexes.


Oh, and you don't need [A-Za-z] in procmail regexes unless
you're expecting to use the "D" flag on the recipe, since procmail
is case-insensitive by default.  Finally, you don't need [+-]
in domain names, as they are illegal for those (though some
local hosts have been known to use them anyway).

-- 
dman

____________________________________________________________
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>