You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Joe Borg <jo...@datastream.com.mt> on 2005/08/09 09:29:07 UTC

Not delivering Spam with Procmail

Hi,
I've setup procmail so as to not deliver mails with a Spam score of 10 or
greater, as follows:

 #Mail that scores 10 or more is not delivered to users.
:0
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*
/var/spool/mail/spam

As may be observed from the above, mails with a Spam score of 10 or greater
should be delivered to a special mailbox /var/spool/mail/spam. So far,
however, only one spam mail has been delivered to this mailbox. Moreover,
spam that should have ended up in this mailbox (such as one with the header
below) is instead still being delivered to the user mailboxes. 

X-Spam-Level: ****************
X-Spam-Status: Yes, score=16.2 required=5.0

I find this behaviour very odd. Does anyone know what I should do to get
this to work properly?
Thanks,

Joe




Re: Not delivering Spam with Procmail

Posted by Nix <ni...@esperi.org.uk>.
On Tue, 9 Aug 2005, Joe Borg said:
> Its easier not to try to count asterisks...
> ------------Sample procmailrc portion
>:0
> * ^X-Spam-Status:.*score=[1-9][0-9]
> {
> 
>:0
> /dev/null
> }
> -------------end sample

Agreed, but you don't have to use regexps for the counting job either.
I use something akin to:

:0
* ^X-Spam-Status: yes, +score=\/[^. ]*
* ? (( ${MATCH} > 9 ))
{

:0
/dev/null
}

which can be a lot easier on the eyes.

-- 
`Tor employs several thousand editors who they keep in dank
 subterranean editing facilities not unlike Moria' -- James Nicoll 

RE: Not delivering Spam with Procmail

Posted by Joe Borg <jo...@datastream.com.mt>.

-----Original Message-----
From: John Andersen [mailto:jsa@pen.homeip.net] 
Sent: 09 August 2005 09:52
To: spamassassin-users@incubator.apache.org
Subject: Re: Not delivering Spam with Procmail

On Monday 08 August 2005 11:29 pm, Joe Borg wrote:
> Hi,
> I've setup procmail so as to not deliver mails with a Spam score of 10 or
> greater, as follows:
>
>  #Mail that scores 10 or more is not delivered to users.
>
> :0
>
> * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*
> /var/spool/mail/spam
>
> As may be observed from the above, mails with a Spam score of 10 or
greater
> should be delivered to a special mailbox /var/spool/mail/spam. So far,
> however, only one spam mail has been delivered to this mailbox. Moreover,
> spam that should have ended up in this mailbox (such as one with the
header
> below) is instead still being delivered to the user mailboxes.
>
> X-Spam-Level: ****************
> X-Spam-Status: Yes, score=16.2 required=5.0
>
> I find this behaviour very odd. Does anyone know what I should do to get
> this to work properly?
> Thanks,
>
> Joe

Its easier not to try to count asterisks...
------------Sample procmailrc portion
:0
* ^X-Spam-Status:.*score=[1-9][0-9]
{

:0
/dev/null
}
-------------end sample

You may want to send them to other than /dev/null
but for my home machine anything that scores 10
or more is something I don't want to see.


-- 
_____________________________________
John Andersen

Thanks for the info John. With your suggestions and, after some meddling
with the mailbox permission (procmail didn't have enough permissions to
write), it seems to be working now. Thanks again.
joe



Re: Not delivering Spam with Procmail

Posted by John Andersen <js...@pen.homeip.net>.
On Monday 08 August 2005 11:29 pm, Joe Borg wrote:
> Hi,
> I've setup procmail so as to not deliver mails with a Spam score of 10 or
> greater, as follows:
>
>  #Mail that scores 10 or more is not delivered to users.
>
> :0
>
> * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*
> /var/spool/mail/spam
>
> As may be observed from the above, mails with a Spam score of 10 or greater
> should be delivered to a special mailbox /var/spool/mail/spam. So far,
> however, only one spam mail has been delivered to this mailbox. Moreover,
> spam that should have ended up in this mailbox (such as one with the header
> below) is instead still being delivered to the user mailboxes.
>
> X-Spam-Level: ****************
> X-Spam-Status: Yes, score=16.2 required=5.0
>
> I find this behaviour very odd. Does anyone know what I should do to get
> this to work properly?
> Thanks,
>
> Joe

Its easier not to try to count asterisks...
------------Sample procmailrc portion
:0
* ^X-Spam-Status:.*score=[1-9][0-9]
{

:0
/dev/null
}
-------------end sample

You may want to send them to other than /dev/null
but for my home machine anything that scores 10
or more is something I don't want to see.


-- 
_____________________________________
John Andersen

Re: Not delivering Spam with Procmail

Posted by jdow <jd...@earthlink.net>.
From: "Bob McClure Jr" <ro...@earthlink.net>

> On Tue, Aug 09, 2005 at 09:29:07AM +0200, Joe Borg wrote:
>> Hi,
>> I've setup procmail so as to not deliver mails with a Spam score of 10 or
>> greater, as follows:
>>
>>  #Mail that scores 10 or more is not delivered to users.
>> :0
>> * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*
>> /var/spool/mail/spam
   ^^^^^^^^^^^^^^^^^^^^ Silliness.

>> As may be observed from the above, mails with a Spam score of 10 or 
>> greater
>> should be delivered to a special mailbox /var/spool/mail/spam. So far,
>> however, only one spam mail has been delivered to this mailbox. Moreover,
>> spam that should have ended up in this mailbox (such as one with the 
>> header
>> below) is instead still being delivered to the user mailboxes.
>>
>> X-Spam-Level: ****************
>> X-Spam-Status: Yes, score=16.2 required=5.0
>>
>> I find this behaviour very odd. Does anyone know what I should do to get
>> this to work properly?
>> Thanks,
>>
>> Joe
>
> Is this recipe in /etc/procmailrc or in each user's .procmailrc?
>
> If the former, I don't know what the problem is.  If the latter, at
> that point procmail assumes the UID of the user.  So the first user's
> email that creates /var/spool/mail/spam owns it and no one else can
> write to it.  You may need to make it world-writable.

Root should probably create it and set privileges to 666. If procmail
allows this as a destination for writing email you're happy. If not
you may have to have "/var/spool/mail/spam/$USER" as a destination
if "$HOME/mail/spam" is not acceptable.

{^_^} 



Re: Not delivering Spam with Procmail

Posted by Bob McClure Jr <ro...@earthlink.net>.
On Tue, Aug 09, 2005 at 09:29:07AM +0200, Joe Borg wrote:
> Hi,
> I've setup procmail so as to not deliver mails with a Spam score of 10 or
> greater, as follows:
> 
>  #Mail that scores 10 or more is not delivered to users.
> :0
> * ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*
> /var/spool/mail/spam
> 
> As may be observed from the above, mails with a Spam score of 10 or greater
> should be delivered to a special mailbox /var/spool/mail/spam. So far,
> however, only one spam mail has been delivered to this mailbox. Moreover,
> spam that should have ended up in this mailbox (such as one with the header
> below) is instead still being delivered to the user mailboxes. 
> 
> X-Spam-Level: ****************
> X-Spam-Status: Yes, score=16.2 required=5.0
> 
> I find this behaviour very odd. Does anyone know what I should do to get
> this to work properly?
> Thanks,
> 
> Joe

Is this recipe in /etc/procmailrc or in each user's .procmailrc?

If the former, I don't know what the problem is.  If the latter, at
that point procmail assumes the UID of the user.  So the first user's
email that creates /var/spool/mail/spam owns it and no one else can
write to it.  You may need to make it world-writable.

You can review that stuff if you want to, but if I went for a month
without finding anything salvageable, I'd change things to summarily
punt anything that scores that high.  I punt anything above 9.0.

Cheers,
-- 
Bob McClure, Jr.             Bobcat Open Systems, Inc.
robertmcclure@earthlink.net  http://www.bobcatos.com
God doesn't have (or need) a Plan B.