procmail
[Top] [All Lists]

Re: Another good one for your Procmail spam filter

1997-04-12 15:33:00
Hi, Actually I was working on this.

ACCEPT=$HOME/.accept
MESSAGE=$HOME/.advice
SPAM_CODE="4321"
FROM=`formail -rtz -x "To:"`

# add people to the list who'm I'm replying to. relys on bcc:

ACCEPT=$HOME/.accept
MESSAGE=$HOME/.advice
SPAM_CODE="4321"
FROM=`formail -rtz -x "To:"`

# add people to the list who'm I'm replying to. relys on bcc:

:0hc
* ^From.*steffi2@
* ^Reply-To(_dot_)*robert(_at_)elastica(_dot_)com
* ! ? $FGREP "$TO" $ACCEPT
| ( formail -I"From: $TO" -rtz -x "To:" >> $ACCEPT)

#| ( formail -R To: From: -U From: -rtzx "To:" >> $ACCEPT)

as you can see the FGREP is kind adventurous as I need TO to scan first.
Kinda catch 22. I can scan but it will scan with comments etc.

Do you think the my commented out attempt will do the same as yours but
in one process? Drawback I see if that it's it's order dependant. Removing
the existing From is much better. But why do you need two formails? 

Swap the From: and the To: and use the same approach?

This will get you what you want:

  formail -I From: -R To: From: -X "From:" | formail -rtzx "To:"

Beautiful, isn't it? :)

That deletes the From: header, renames the To: header to From:, and then
pipes it into a second formail to grab the return address from the new
From: header.

-- Lars

---
Lars Kellogg-Stedman * lars(_at_)bu(_dot_)edu * (617)353-8277
Office of Information Technology, Boston University


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