procmail
[Top] [All Lists]

Some general questions

2002-11-24 21:29:06
Howdy all.  My munging recipe is getting closer a little at a time.  I've
now taken SpamAssassin off of my test box and put it on my production box
so I'm removing my SA headers as part of the munging.  I'm also removing
MIMEDefang X-Scanned-By header.  I'm having a little trouble with
the subject though.  I've configured SA to prepend "***SPAM*** " to the
Subject if the score is >=10.  I'm removing that string before I quote the
headers and body in the forwarded message but the Subject match I'm doing
earlier on is the complete subject.  Here's the full recipe:

# 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:

        :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_)sktc(_dot_)net" \
                -I "X-Spam-Loop: $BOUNCER" \
                -A "From: $BOUNCER") | \
                $SENDMAIL -t -f $BOUNCER

        :0:
        munged
}

I'm not sure how I should go about matching the subject line but yet not
have the spam string.  Any thoughts?

While I'm asking about the subject matching, I just noticed something that
I think I messed up when I copied and pasted that recipe.  I currently
have 4 spaces in the first set of brackets and 2 in the last.  If that's
supposed to match whitespace, should I have a tab and space in each of
those?  Copying and pasting from a terminal or web page (list archives)
would have eliminated the tabs).

I have a question about the first sed line too.  Can anyone think of a
good way to match multiple domains from a list?  Since I host multiple
domains, I'm wondering if procmail could do some for i in $LIST looping
while checking for each of domains we host/use.  Optionally I could just
create a recipe for each and run it through each corpus by whenever I want
to auto-report spam.

Something one of the list members said a while back got me wondering about
munging parts of the body that pertain to unsubscribe lines and such.
That made me wonder if I could pull matches out of the userid portion of
the first sed line and run the body through sed again for that string.  Is
that doable or am I on the wrong track?  Is there a better technique or
should I even worry about it?  I'm posting to NANAS and forwarding to the
FTC with this recipe.

I couldn't manange to archor the second sed regex.  Do I need to worry
about it?  regex aren't my speciality but I'm working on learning.

Finally, (yes, finally! :) ) I have a question about the remainder of the
recipe.  I found the last sed line in a procmail FAQ here, #12.7:

http://mirror.ncsa.uiuc.edu/procmail/ssjaaa/pm-tips.html

I also found the formail -X line and the performance tip to make formail a
variable so I don't have to waste cycles on shell lookups for formail (I
extended that to sed and soon to spamassassin).  However this is causing a
small problem.  The mail isn't going where I wanted it to. :)  Apparently
I'm misusing -rt because the x10 spam I bounced from one of my accounts to
this spamtrap account isn't actually going to 
spamcan(_at_)sktc(_dot_)net(_dot_)  It's
going back to the x10.com sender.  Whoops.  FAQ 12.7 is a bit confusing to
me.  It says

| $FORMAIL -rt; ... now generate reply ...

Do I remove the semi-colon and add in my -A and -I lines?  Do I pipe -rt
into the my next formail command?  Should I even be using -rt?


I'm trying to absorb the FAQ but that's a lot of material to absorb.  If
anyone can point me in the right direction, I'd greatly appreciate it.
I'm sooo close to making this one work that I'm dreaming of cleansing some
of my spamtrap at night...

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>
  • Some general questions, listuser <=