You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by "sebastian@debianfan.de" <se...@debianfan.de> on 2009/04/05 01:56:38 UTC

need help - procmail & spamassassin

Hello,

i am filtering mails with spamassassin & procmail.


The header of message

X-Spam-Level: ******************

I want to sort mails into some different directories.

10 or more --> directory 10
9 --> directory 9

and so one....

But - nothing happens - the mails are all in the /Maildir/new directory

why ?

Thx


:0:
* ^X-Spam-Level: .*\(\*\*\*\*\*\*\*\*\*\*
Maildir/10/new

:0:
* ^X-Spam-Level: .*\(\*\*\*\*\*\*\*\*\*
X-Spam-Level: *******
Maildir/9/new


:0:
* ^X-Spam-Level: .*\(\*\*\*\*\*\*\*\*
Maildir/8/new

:0:
* ^X-Spam-Level: .*\(\*\*\*\*\*\*\*
Maildir/7/new

:0:
* ^X-Spam-Level: .*\(\*\*\*\*\*\*
Maildir/6/new

:0:
* ^X-Spam-Level: .*\(\*\*\*\*\*
Maildir/5/new


:0:
* ^X-Spam-Level: .*\(\*\*\*\*
Maildir/4/new

:0:
* ^X-Spam-Level: .*\(\*\*\*
Maildir/3/new

:0:
* ^X-Spam-Level: .*\(\*\*
Maildir/2/new

:0:
* ^X-Spam-Level: .*\(\*
Maildir/1/new

:0
Maildir/new


Re: need help - procmail & spamassassin

Posted by René Berber <r....@computer.org>.
sebastian wrote:

> i am filtering mails with spamassassin & procmail.
> 
> 
> The header of message
> 
> X-Spam-Level: ******************
> 
> I want to sort mails into some different directories.
> 
[snip]
> :0:
> * ^X-Spam-Level: .*\(\*\*\*\*\*\*\*\*\*\*
---------------------^^
You are quoting an opening parenthesis, the header doesn't have one.
-- 
R.Berber


Re: need help - procmail & spamassassin

Posted by Karsten Bräckelmann <gu...@rudersport.de>.
> i am filtering mails with spamassassin & procmail.

> 10 or more --> directory 10
> 9 --> directory 9
> 
> and so one....
> 
> But - nothing happens - the mails are all in the /Maildir/new directory

Given your last recipe, Maildir/new isn't a directory but an mbox
formatted file. Was that a straight, unaltered copy-n-paste, or did you
modify it for the post?


> :0:
> * ^X-Spam-Level: .*\(\*\*\*\*\*\*\*\*\*\*
> Maildir/10/new

Summarizing the previous posts, all excellent advice and pointing out a
single issue:

* Are you really sure you want to do that? That's a massive amount of
folders to look at, and really not worth it. Almost all of the spam is
likely to end up in the single "score 10 or above" folder anyway...

* The RE is broken. You do not want the greedy matching .* at the
beginning of the series of asterisks. And the literal escaped \(
parenthesis doesn't exist in that header. Did you have a look at the
sample procmail recipes provided by SA?

* Your Maildir named folder is not in Maildir format. At least not,
given that procmail delivery line. It will use "new" as an mbox
formatted *file*.


> :0:
> * ^X-Spam-Level: .*\(\*\*\*\*\*\*\*\*\*
> X-Spam-Level: *******
> Maildir/9/new

Oh, and this one won't work anyway and doesn't even parse procmail
syntax...


-- 
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}


Re: need help - procmail & spamassassin

Posted by LuKreme <kr...@kreme.com>.
On 5-Apr-2009, at 06:07, Matus UHLAR - fantomas wrote:
> On 05.04.09 01:56, sebastian@debianfan.de wrote:
>> i am filtering mails with spamassassin & procmail.
> [...]
>> :0:
>> * ^X-Spam-Level: .*\(\*\*\*\*\*\*\*\*\*\*
>> Maildir/10/new
>
> Maildir/10/new is not a maildir, is it?
> Maildir/10/ may be a maildir, if it is, use Maildir/10/, don't add / 
> new
> there.

Also, in most Maildirs the path would be

.10/

(that is, the procmail MAILDIR would already be set to the Maildir,  
and the sperator is a . not a / in most cases.

(Procmail MAILDIR is not a Maildir)

-- 
But just because you've seen me on your TV Doesn't mean I'm any
	more enlightened than you


Re: need help - procmail & spamassassin

Posted by Matus UHLAR - fantomas <uh...@fantomas.sk>.
On 05.04.09 01:56, sebastian@debianfan.de wrote:
> i am filtering mails with spamassassin & procmail.
[...]
> :0:
> * ^X-Spam-Level: .*\(\*\*\*\*\*\*\*\*\*\*
> Maildir/10/new

Maildir/10/new is not a maildir, is it?
Maildir/10/ may be a maildir, if it is, use Maildir/10/, don't add /new
there.

-- 
Matus UHLAR - fantomas, uhlar@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
   One OS to rule them all, One OS to find them, 
One OS to bring them all and into darkness bind them 

Re: need help - procmail & spamassassin

Posted by Matt Kettler <mk...@verizon.net>.
Jeff Mincy wrote:
>    From: "sebastian@debianfan.de" <se...@debianfan.de>
>    Date: Sun, 05 Apr 2009 01:56:38 +0200
>    
>    Hello,
>    
>    i am filtering mails with spamassassin & procmail.
>    
> This is more of a procmail question, so it doesn't actually belong here.
>   
It's related to using SpamAssassin, so it's perfectly acceptable on this
list.

In general there's a long tradition of providing advice for
configuration of tools to help them make use SA on this list. Procmail
and otherwise.

Of course, there's always situations beyond the expertise of those here,
so we do regularly point folks to the list for the tool, but that's more
of a "sorry, that's beyond us.. try the experts.."





Re: need help - procmail & spamassassin

Posted by Jeff Mincy <je...@delphioutpost.com>.
   From: "sebastian@debianfan.de" <se...@debianfan.de>
   Date: Sun, 05 Apr 2009 01:56:38 +0200
   
   Hello,
   
   i am filtering mails with spamassassin & procmail.
   
This is more of a procmail question, so it doesn't actually belong here.

   The header of message
   
   X-Spam-Level: ******************
   
   I want to sort mails into some different directories.
   
   10 or more --> directory 10
   9 --> directory 9
   
   and so one....
   
Do you really want that many different mail folders?   Wouldn't low>=5,
mid>=10 and high>=15 be sufficient?

   But - nothing happens - the mails are all in the /Maildir/new directory
   why ?
   
The .*\( part.

   :0:
   * ^X-Spam-Level: .*\(\*\*\*\*\*\*\*\*\*\*
   Maildir/10/new

You don't need the .* and you don't want the \(

* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*

Also, You can use the numeric score directly.

For example, you can set X_SPAM_SCORE in a procmail recipe the be the
number following score= on the X-Spam-Status line.

 X_IS_SPAM="Unknown"
 X_SPAM_SCORE=""
 :0
 * ^X-Spam-Status: \/.*
 {
   :0
   * ^X-Spam-Status: \/(Yes|No|YES|NO|Skipped)
   { X_IS_SPAM="$MATCH" }

   :0
   * ^X-Spam-Status: (Yes|No|YES|NO)[, ]+(hits|score)=\/([-0-9.]+)
   { X_SPAM_SCORE="$MATCH" }
 }

Then you can do recipes like this that matches spam scoring 12.5 or higher.

 SPAM_CUTOFF=12.499
 :0
 * X_IS_SPAM ?? (Yes|YES)
 *$ -$SPAM_CUTOFF ^0
 *$  $X_SPAM_SCORE ^0
 somefolder
   
   :0:
   * ^X-Spam-Level: .*\(\*\*\*\*\*\*\*\*\*\*
   Maildir/10/new
   
   :0:
   * ^X-Spam-Level: .*\(\*\*\*\*\*\*\*\*\*
   X-Spam-Level: *******
   Maildir/9/new

You don't want the extra 'X-Spam-Level: *******' line here.

-jeff