procmail
[Top] [All Lists]

Re: rewriting the subject line

2004-10-06 11:09:15
On Wed, Oct 06, 2004 at 01:15:26PM -0400, Curtis Maurand wrote:

Dallman Ross wrote:

On Wed, Oct 06, 2004 at 11:37:41AM -0400, Curtis Maurand wrote:


If I spotted something as spam as below, how would I use formail to 
insert the tag into the subject before sending it on to the user.

:0 B:
* yourfirstchoiceitem\.com
{
TAG = " *** SPAM ***"
}


:0 fw h
* B ?? ()\<yourfirstchoiceitem\.com\>
* H ?? ^Subject:\/.*
| formail -I "Subject: *** SPAM ***$MATCH"



This is a good start, but I have a couple of hundred rules.  I'd rather 
set a variable, then if the variable is set, then rewrite the subject line.

Hmm.  Well, you already demonstrated in the quoted text that you know how
to set your $TAG.  :-)  Just put another condition in the recipe I offered
testing for the existence of your tag.  If it's there, do the rewrite.
And you won't need the first condition I offered, then.



 :0 fw h
 * TAG ?? .
 * ^Subject:\/.*
 | formail -I "Subject:$TAG$MATCH"

Btw, I didn't need the "H ??" thing in that condition, since
"H" is the default fo conditions.

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