From: John Summerfield <summer(_at_)OS2(_dot_)ami(_dot_)com(_dot_)au>
Just wondered if it's possible to extract two lines such as
Subject and X-Mailer... I tried but didn't find a way of
doing it.
I'd use egrep;
egrep -i '^X-Mailer:|^Subject:' <mailbox
Why?
The formail solution offered works fine - as a later
post showed, you can add other headers to hit on easily.
Your method is liable to hit a false positive pretty
easily. Example:
From bar(_at_)foo
Subject: RE: blah
To: foo(_at_)bar
X-Mailer: blah
I just wrote you a message that had the following
Subject: blah. Did you get it? It also had
X-Mailer: blah in it. I sure hope you got it!
Signed,
blah
Your egrep would count two Subject: hits and two X-Mailer:
hits. formail, otoh, would get it right. It knows that
a new mail message has not started.
--
\ .-. .-. .-. .-. .-. .-. .-. /
\-d-/-m-\-a-/-n-\-(_at_)-/-n-\-e-/-t-\-c-/-o-\-m-/-.-\-c-/-o-\-m-/
'-' '-' '-' '-' '-' '-' '-' '-'
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail