aggarwal asked,
| > 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
|
|
| :0
| * ^From:(_dot_)*joe(_at_)shmoe\(_dot_)com
| {
| SUBJECT=`formail -zxSubject:`
|
| :0fhw
| | formail -I"Subject: [shmoe] $SUBJECT"
| }
|
| will do what you want
Better, because it uses one process fewer,
:0fhw
* ^From:(_dot_)*joe(_at_)shmoe\(_dot_)com
* ^Subject:[ ]*\/[^ ].*
| formail -I "Subject: [shmoe] $MATCH"
The first pair of brackets enclose space and tab; the second enclose caret,
space, and tab.