procmail question

Sean Roe sean152 at gmail.com
Wed Aug 26 16:34:11 MST 2015


Hi All,

Im trying to dig up some ancient procmail knowledge and I cant seem to find
it.  All I want to do is take a email look at the subject line extract out
a variable and use that variable to send the email to an file based on that
name to be processed later;
Example:

recipe:
LOGFILE=$HOME/.procmailrc.log
MAILDIR=$HOME/Mail
VERBOSE=yes
PATH=/usr/bin

:0:
* ^FROM bipublisher-notification at oracle.com
{
EGR = `formail -xSubject: | /bin/sed -e 's/([A-Z]{2,3}\d{2}|PROD)//g'`
/tmp/bi_pub_"$EGR"
}
:0
* ^FROM bipublisher-report at oracle.com
/dev/null


the string in the subject line:

Oracle BI Publisher Notification: [DEV01]: Job was successfully  processed.

so sed looks for 2 or 3 capital letters 2 numbers or the word PROD. and Im
trying to write out to /tmp/bi_pub_DEV01 or whatever the value from the EGR
variable.

Any guidance would be helpful.  The online resources seem a little obtuse.

Sean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phxlinux.org/pipermail/plug-discuss/attachments/20150826/a32d1884/attachment.html>


More information about the PLUG-discuss mailing list