procmail
[Top] [All Lists]

Recipe woes

2003-05-28 11:12:55
Howdy.  I'm having an awful time getting a recipe of mine to work.  I've
gone through the FAQs and tips sites looking for examples and have
thoroughly managed to confuse myself.  This recipe has been a
work-in-progress for over a year now.  If anyone can point me in the right 
direction, I'd greatly appreciate it.

The goal of this script is to munge my users' information from spam and
forward it on to the FTC and NANAS as well as archive the spam locally.  
I'm trying to munge all instances of my users addresses from both the
headers and the body.  That part is relatively easy.  What I'm having
trouble on is the quoting of the original message.  I need to quote the
full headers and body of the original spam in the body of the new message
(forward).  I haven't been able to figure that out.  I believe the munging
is working.  Here's the state my recipe is currently in:

# Extract subject and assign it to SUBJECT
:0
* ^Subject:[    ]*\/[^  ].*
{
         SUBJECT=$MATCH
}
        
:0 c
* $ ! ^X-Spam-Loop: $BOUNCER
{
        :0f
        | spamassassin -d | \
          $SED -e 
"s/\<[-+_a-zA-Z0-9]*(_at_)[-_a-zA-Z0-9\(_dot_)]*sktc\(_dot_)net/MUNGED(_at_)sktc(_dot_)net/gi"
 \
               -e "s/\*\*\*SPAM\*\*\* *//gi" | \
          $FORMAIL -I ReSent \
                   -I X-Envelope-To: \
                   -I X-Scanned-By:
 
        # What is this doing?
        :0 fhw r
        | $SED -e H -e '$ G'

        :0f
# Thought in progress?
#       * $ $FORMAIL -X ""
#       {
#       HEADER=$MATCH
#       }
#        | (cat $AUTOREPLY/$BOUNCEMSG - | \
        | ($FORMAIL -rt; $FORMAIL -I "Subject: [email]  $SUBJECT" \
                -I "To: spamcan(_at_)numbnuts(_dot_)net" \
                -I "X-Spam-Loop: $BOUNCER" \
                -A "From: $BOUNCER") | \
                $SENDMAIL -t -f $BOUNCER
               
        :0:
        munged
}


I'm currently forwarding the message to a local account for testing 
purposes.  I'm also dumping a copy in "munged" to confirm that the munging 
worked.  As you can see I've had a number of thoughts-in-progress.  I 
imagine most were created after seeing something in the FAQ or someone 
else's recipe.

I'm thoroughly confused.  If anyone can help out or point me in the right 
direction, I'd greatly appreciate it.

Many thanks
 Justin


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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