procmail
[Top] [All Lists]

Re: Spam escaping the filter

2007-09-10 07:46:19
Hi, and first of all thanks for replying. :)

On 07/09/2007, Professional Software Engineering
<PSE-L(_at_)mail(_dot_)professional(_dot_)org> wrote:
A VERBOSE LOGFILE might be useful in determining why.  Near the top, set:

         VERBOSE=ON

Set!


I'm gonna go out on a limb and say you'll likely find that all the messages
that don't get tagged have NO SUBJECT.

In fact, they have subject.


(...) As your rules are written, you're
extracting the contents of the Subject header - in doing so, you're also
expecting that the header be PRESENT (though it can be EMPTY).  By moving
that header extraction OUT of the conditions, you eliminate it as a
required header.

I will try that out.


# extract the subject, separate from conditions
# note I prefix the assignment with a literal space - this is so that when I
# use the variable later, it comes with a space - and if it's UNSET, it won't
# add a meaningless space into the new subject you create.
:0
* ^Subject:\/.*
{
         $OURSUBJ=" ${MATCH}"
}

# optional - you can omit this if you want.
# (though a present but BLANK Subject will match the above recipe)
:0E
{
         $OURSUBJ=" (no original subject)"
}

:0
* ^X-Spam-Level: \*\*\*
{
         SPAMLEVEL=" [SPAM 1]"
}

:0E fh w
| formail -I "Subject: [HELPDESK]${SPAMLEVEL}${OURSUBJ}"


This not only should fix your unflagged problem, but is a lot more
efficient - you're not getting the subject multiple times, and you're not
SETTING it multiple times.

Thanks alot for the recipe. I will put it on the server and reply to
you to say how it goes. :)


You should also set a shell up at the top of your recipe file, since this
isn't being exectuted on behalf of a regular user (your mail account user
may have a non-existant or restritcted shell specified in the password db):

         SHELL=/bin/sh

(or whatever is appropriate).

Ok. I don't quite understand the purpose of that, but I'm using bash,
so I will put a /bin/bash on top of the recipe.


# The lock file ensures that only 1 spamassassin invocation happens
# at 1 time, to keep the load down.

I don't use SA myself, but I've done a little bit of maintenance on it, and
IIRC, SA has config options for throttling itself.  You may want to look
into that, especially where DNSBL lookups could cause 10 sequential
operations to take longer than 10 concurrent ones, because it's not all
about processor load.

Thanks alot for the tip. I will take a look on that. :)

Regards.

Pedro Machado Santa
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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