procmail
[Top] [All Lists]

Re: Adding a subject line

2002-02-06 21:32:31
At 20:02 2002-02-06 -0800, Chuck Charlton wrote:
This email has a null subject line.  I would like to add a
subject line of

        Baker


Let's assume that your first recipe actually matches the message in question, and perhaps has similar conditions to the following:

:0fh
* From:[        ]*root(_at_)able\(_dot_)com
* Subject:[     ]*$
| formail -I"Subject: Baker"


The 'f' flag says to FILTER this message, the 'h' flag says to diddle only with the header (you're not asking to mess with the body, so let's not do anything special with that if it isn't necessary), then piping it into formail with the appropriate argument will set/replace the Subject header.

Note that the above Subject condition says if the Subject header EXISTS, but is at most whitespace, nothing more. If you want an ABSENCE of a subject header altogether, replace that with:

* ! ^Subject:


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

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