procmail
[Top] [All Lists]

Re: Searchhing for words in external word list?

2008-12-11 15:19:52
On 11-Dec-2008, at 07:07, emailjp79(_at_)gmx(_dot_)de wrote:
WHITELIST = $PROCMAILDIR/whitelist
FROM=`formail -xFrom: | sed -e ': stripcomments s/([^()]*)//; t
stripcomments; s/.*<\([^ >]\+\)>.*/\1/; t; s/^ \+//; s/ \+$//'`
:0
* ? fgrep -qxsi "$FROM" "$WHITELIST"
{
LOG = "OK FROM "
:0
$INBOX/
}

er... what now?  That From assignment seems a bit over the top

:0 h
CLEANFROM=|formail -IReply-To: -rtzxTo:

WHITELIST=$HOME/.friends
ISLISTED=`grep -i "^$CLEANFROM " $WHITELIST`
:0
* ISLISTED ?? ^[^ ]+[   ]+\/[^  ]+
$MATCH

READLIST=$HOME/.readlist
READIT=`grep -i "^$CLEANFROM" $READLIST`
LOG="readlist=$READLIST CLEANFROM=$CLEANFROM READIT=$READIT$NL"

:0f
* ! READIT ?? ^^^^
| formail -I"Status: RO"-I"X-Covisp-Readlist: ${READIT}"

.friends:
email(_at_)example(_dot_)com Friends
emai2(_at_)example(_dot_)com Mom
email3(_at_)example(_dot_)com Bob

.readlist:
root(_at_)server(_dot_)tld
postmaster(_at_)server(_dot_)tld

(friends each email address is sorted into the appropriate amilbox, readlist each email is marked as read)

However, your example is merely whitelisting based on email address, and not tagging things based on badwords.

To do that, you would need to do something like

* $ ^Subject:(.*\<)?($BADWORDS)

(note the $ between * and ^ and the parentheses around $BADWORDS)


--
Women and cats will do as they please, and men and dogs should
        relax an get used to the idea.

____________________________________________________________
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