When Rajiv Baronia asked:
B> Basically, I would like to extract the "Subject" field from a message
B> and pass it to a shell program in the form of a variable.
Guy Geens suggested:
G> This should do the trick:
G> SUBJECT=`formail -zxSubject:` # these are backquotes
G> :0 <flags>
G> * conditions
G> | program $SUBJECT
If your version of procmail is new enough to support extraction (and it
probably is if your version of formail is new enough to have the -z option),
this is better because it saves a process:
:0 <flags>
* conditions, including this one:
* ^Subject:.*\/[^ ].*
| program "$MATCH"