At 12:41 PM 8/20/99 -0500, David W. Tamkin wrote:
| > if i get a message from joe(_at_)shmoe(_dot_)com with subject "hey there"
| > i would like to change the subject to "[shmoe] hey there"
Timothy Luoma responded,
| I think
| * ^From:(_dot_)*joe(_at_)shmoe\(_dot_)com
| SUBJECT=`formail -zxSubject:`
| | formail -I"Subject: [shmoe] $SUBJECT"
| will do what you want
Better, because it uses one process fewer,
* ^Subject:[ ]*\/[^ ].*
| formail -I "Subject: [shmoe] $MATCH"
The first pair of brackets enclose space and tab; the second enclose caret,
space, and tab.
It is probably worth noting that these two approaches will differ
in their treatment of any mail that doesn't have a Subject: header.
Specifically, Timothy's will insert
(give or take trailing white space), whereas David's will not add
a Subject: at all.