On Jul 26, 2:55pm, David W. Tamkin wrote:
Subject: Re: How do I extract the "Subject"
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"
-- End of excerpt from David W. Tamkin
Thanks to Guy Geens and David W. Tamkin, I have found the solution.
In my situation, however, the solution suggested by David works better
for me, as I do not have new formail. Also as David pointed out - it saves
a process.
Again, thanks a bunch!
- Rajiv