match and export subject line and from header with procmail

Posted by Nick on Server Fault See other posts from Server Fault or by Nick
Published on 2012-07-11T03:02:19Z Indexed on 2012/07/11 3:17 UTC
Read the original article Hit count: 410

Filed under:
|

I would like to use procmail or a combination of procmail and formail to take an email message and match a specific keyword in the Subject: line/header, and if matched, export the contents of the Subject: line/header, and the contents of the From: line/header to a perl script.

I have researched this, and have not been able to get this working all the way. I am new to procmail, and I assume I need to use a nesting block, but I am not sure how to get the data and then export it. I have been able to match the subject line and export it to a perl script where it is read via ARGV0, but get lost when trying to export and match multiple fields.

I tried subscribing to the procmail listserv, but it appears to be broken.

Can someone help me with this, please?

© Server Fault or respective owner

Related posts about procmail

Related posts about perl-scripts