procmail
[Top] [All Lists]

Problem with bounce messages

1998-02-20 11:20:43
I have a procmail script I haven't played with for a while that is 
broken.  The first few lines are supposed to send any mailer daemon 
message to another address.  I suspect this is becasue I lack a ":0 
<sometheing else>" at the beginning near the daemon rule, but when I add 
just an ":0" everything goes to the alternate address, which isn't good.  
Since this system is in production, I don't want to do too much 
experimeting since my procmail knowledge is lackluster at best.  If you 
could help me make the first two rules work, that would be great.  If you 
need the rest of the script, let me know.  Thanks a ton!

--script--
SIMDIR=$HOME/preprocessed

# Deliver mail to HPGBCADM(_at_)harvassoc(_dot_)com if it is not a decision
#:0
#* ! ^Subject:*
#! hpgbcadm(_at_)harvassoc(_dot_)com

# Send mail to daemon if bounce message
#:0
* !^FROM_DAEMON
! hpgbcadm(_at_)harvassoc(_dot_)com

ERR             # No errors yet

# Main error message
ERRMSG="The following decision message was received by the MESE Decision
Processing System.  You will need to resubmit your decisions.
This message could not be processed because:

"

# Look for keywords and associated values
:0 B
* TEAM[        ]+\/[^         ]+.*
{ TEAM=$MATCH }

# Missing TEAM
:0 E
{ ERR="The Team name is missing or was not understood!" }

:0 B
* PASSWORD[     ]+\/[^  ]+.*
{ PASS=$MATCH }

...more similar stuff...

..then...

# Get the date
DATE=`date`

# Any errors?
:0
* ERR ?? .
{
        # replace the headers with a reply header
        :0 fh
        | formail -rt -I"Subject: Re: $SUBJ"

        # replace the body with the error message(s), and quote the
        # origional message
        :0 fb
        | ( echo "$ERRMSG$ERR$ERREND" ; sed -e 's/^/> /' )

        # deliver it finnally
        :0
        ! -oi -t
}
# Good reply -- save results

# Place tokens in file, seperated by " : ".
:0 c :$TEAM.lock
|echo -e 
"**\n$DATE\n$SENDER\n$TEAM\n$PASS\n$PRICE\n$PRODUCTION\n$MARKETING\n$IN
VESTMENT\n$RD" >> $SIMDIR/$TEAM

:0 A
|/usr/users/decision/preprocessed/makedec 
/usr/users/decision/preprocessed/$TEAM

<Prev in Thread] Current Thread [Next in Thread>