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@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@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