Skip | 4 Jul 2008 22:58
Favicon

Help with recipe

I'm trying to write a recipe that has several blocks which check for 
certain spam conditions, added by spamassassin and dspam.  When those 
conditions are met, it should
1.  Add a header to the email which tells me what rule filed the email 
so I won't have to go through the logs
2.  Deliver the message
3.  Mark it read
4.  Learn it with sa-learn as spam

I think I have tried every combination placement and header options, but 
I haven't nailed the right combination just yet.  Perhaps one of you 
smart readers can help me?

Here's where I am now.  This actually does everything it's supposed to, 
but I get extra emails from all the extra clonings (sometimes a message 
may meet the conditions of more than one block).

:0c
* ^X-Spam-Status:.*autolearn=no
* ^X-Spam-Status:.*BAYES_99
* ^X-DSPAM-Result: Spam
{
  foldername=Spam-Archive

#add the header
  :0fhw:formail.lock
  |/usr/bin/formail -A "X-Procmail-Rule: spamassassin autolearn=no, 
BAYES_99 and dspam-result=spam"

#delivers to foldername/new
(Continue reading)

N.J. Mann | 5 Jul 2008 12:24

Re: Help with recipe

In message <486E8EDA.9000205 <at> pelorus.org>,
	Skip (skip <at> pelorus.org) wrote:
>
> I'm trying to write a recipe that has several blocks which check for
> certain spam conditions, added by spamassassin and dspam.  When those
> conditions are met, it should
> 1.  Add a header to the email which tells me what rule filed the email
> so I won't have to go through the logs
> 2.  Deliver the message
> 3.  Mark it read
> 4.  Learn it with sa-learn as spam
>
> I think I have tried every combination placement and header options, but
> I haven't nailed the right combination just yet.  Perhaps one of you
> smart readers can help me?

Lets see if I can help.  I have never used spamassassin - I was put off
by all the negative comments floating around on various mailing lists -
and although I did consider using dspam I opted for bogofilter which I
find to be excellent and very easy to use.

> Here's where I am now.  This actually does everything it's supposed to,
> but I get extra emails from all the extra clonings (sometimes a message
> may meet the conditions of more than one block).
>
> :0c

Why is this a "copy" when you have HOST at the end?

> * ^X-Spam-Status:.*autolearn=no
(Continue reading)

Robert Holtzman | 6 Jul 2008 05:59
Picon

recipe failure

I've done a lot of RTFMing and internet searching but can't find an answer to this.
I have been going nuts for a long time trying to get procmail to transfer one mailing 
list's messages into the appropriate Alpine file. I posted about this to 
the list quite a while ago and got a couple of suggestions that didn't 
work. I'm hoping someone may have some other ideas.

The email headers I'm trying to filter on are

To: Main PLUG discussion list <plug-discuss <at> lists.plug.phoenix.az.us>

and

List-Id: Main PLUG discussion list <plug-discuss.lists.plug.phoenix.az.us>

I have tried:

:0:
* ^TO:.*<plug-discuss <at> lists.PLUG.phoenix.az.us>
$HOME/holtzm/mail/list-PLUG-discuss

:0:
* ^List-ID:.*plug-discuss <at> lists.plug.phoenix.az.us
$HOME/holtzm/mail/list-PLUG-discuss

:0:
* ^TO:.(plug-discuss <at> lists <at> plug.phoenix.az.us|plug-announce-admin <at> lists <at> plug.phoenix.az.us)
$HOME/holtzm/mail/list-plug-discuss

:0:
* ^TO:.plug-discuss <at> lists.plug.phoenix.az.us
(Continue reading)

Patrick Shanahan | 6 Jul 2008 06:36
Picon

Re: recipe failure

* Robert Holtzman <holtzm <at> cox.net> [07-06-08 00:06]:
> I've done a lot of RTFMing and internet searching but can't find an answer to this.
> I have been going nuts for a long time trying to get procmail to transfer one mailing 
> list's messages into the appropriate Alpine file. I posted about this to 
> the list quite a while ago and got a couple of suggestions that didn't 
> work. I'm hoping someone may have some other ideas.
> 
> The email headers I'm trying to filter on are
> 
> To: Main PLUG discussion list <plug-discuss <at> lists.plug.phoenix.az.us>
> 
> and
> 
> List-Id: Main PLUG discussion list <plug-discuss.lists.plug.phoenix.az.us>
> 
> I have tried:
> 
> :0:
> * ^TO:.*<plug-discuss <at> lists.PLUG.phoenix.az.us>
> $HOME/holtzm/mail/list-PLUG-discuss
> 
> :0:
> * ^List-ID:.*plug-discuss <at> lists.plug.phoenix.az.us
> $HOME/holtzm/mail/list-PLUG-discuss
> 

 ...

> I have also tried "TO_" for all of these but they generated lock failures.
> Everything I try generates a log entry such as:
(Continue reading)

rmborchers | 6 Jul 2008 07:55
Picon

Re: recipe failure


Bob,

I think the problem with your recipe is the case of the headers
You don't get a match on List-ID when the header is List-Id the same
goes for TO if the header is To. The same goes for plug and PLUG.

This one should do the trick

:0:
* ^To.*<plug-discuss <at> lists.plug.phoenix.az.us>
* ^List-Id.*plug-discuss <at> lists.plug.phoenix.az.us
$HOME/holtzm/mail/list-PLUG-discuss

Rene
--

-- 
                             \\\                      
                            (0 0)                      
--------------------------o0o(_)o0o-------------------------
Registered Linux User No.291649 http://www.linux-counter.org
Registered LFS user No.16792 http://www.linuxfromscratch.org
Uptime   : 07:39:12 up 22 min,  1 user,  load average: 0.23, 0.67, 0.72
Kernel   : Linux 2.6.18.8.tex5 #1 SMP Thu May 10 11:36:58 WST 2007
Processor: model name	: AMD Turion(tm) 64 Mobile Technology ML-30
web: http://rene-borchers.homelinux.com
------------------------------------------------------------
patent:
	A method of publicizing inventions so others can copy them.
Ruud H.G. van Tol | 6 Jul 2008 09:52
Picon

Re: recipe failure

Robert Holtzman schreef:

> :0:
> * ^TO:.*<plug-discuss <at> lists.PLUG.phoenix.az.us>
> $HOME/holtzm/mail/list-PLUG-discuss

The ^TO is a macro, check in `man procmailrc` what it stands for.

Hint: you need to remove the ":.*" from your regex.

You are probably better of with ^TO_. And you also need to escape the
dots.

--

-- 
Groet, Ruud

Re: recipe failure

At 07:55 2008-07-06 +0200, rmborchers <at> orange.nl, "Borchers 
<rmborchers" <at> orange.nl wrote:

>I think the problem with your recipe is the case of the headers
>You don't get a match on List-ID when the header is List-Id the same

BZZT.  Unless the case-sensitivity flag is explicitly set (D), Procmail is 
case-insensitive.  see 'man procmailrc'

Also, if you read 'man procmailrc', you'd see that the ^TO and ^TO_ 
expressions which the OP tried are procmail regexp MACROs.

An actual message header and output from the logs corresponding to the 
attempted recipes would generally be appropriate.  I expect it may be 
matching but failing to deliver to the location specified, and as such is 
continuing to deliver to default.  If the ignore failures flag was on the 
recipe, the messages would probably just "vanish", which would support that 
they're being MATCHED, but failing to deliver, which is almost universally 
a permissions issue.

This particular line though is telling:

* 
^TO:.(plug-discuss <at> lists <at> plug.phoenix.az.us|plug-announce-admin <at> lists <at> plug.phoenix.az.us)

Ignore the failure to excape literal dots -- please explain why are there 
TWO  <at>  in each of those addresses?

I rather suspect that the second  <at>  in each of those is supposed to be a 
dot.  If no, then try:
(Continue reading)

Alitrix aka Ali | 6 Jul 2008 20:17
Picon

Procmail for outgoing mail

Is there a way to make procmail works for outgoing mail as well?

I want to do that, so I can filter outgoing email to specific dirs.
For example:
* <at> domain.com -> Sent/domain_com


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail <at> lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail
Jim Seavey | 7 Jul 2008 16:09

Recipe failing....Why?

I am using Spambouncer as a filter and am happy with it.

But, like all things, it is not perfect. Some email that I consider spam 
gets through.

I want to filter this stuff to /dev/null and have been working on the 
following recipe to do that, alas, to no avail.

# Kill specific email
:0
* ^From:[       ]*(intl\.paypal\.com|\
                          chaseonline\.chase\.com)|\
* ^Subject:[    ]*(\<penis?\>|\
                            \<porn?\>|\
                            \<viagra?\>|\
                            \<watches?\>|\
                            \<xxx?\>|\
                           \<jwseavey?\>|\
                            \<verna?\>|\
                            \<joanreitz?\>|\
                            \<genereitz?\>)|\
* ^To:[         ]*To:
/dev/null

What is wrong with the above recipe?

Thanks,

Jim
Patrick Shanahan | 7 Jul 2008 17:39
Picon

Re: Recipe failing....Why?

* Jim Seavey <procmail <at> norseaodyssey.com> [07-07-08 10:14]:
> I am using Spambouncer as a filter and am happy with it.
> 
> But, like all things, it is not perfect. Some email that I consider spam 
> gets through.
> 
> I want to filter this stuff to /dev/null and have been working on the 
> following recipe to do that, alas, to no avail.
> 
> # Kill specific email
> :0
> * ^From:[       ]*(intl\.paypal\.com|\
>                          chaseonline\.chase\.com)|\
> * ^Subject:[    ]*(\<penis?\>|\
>                            \<porn?\>|\
>                            \<viagra?\>|\
>                            \<watches?\>|\
>                            \<xxx?\>|\
>                           \<jwseavey?\>|\
>                            \<verna?\>|\
>                            \<joanreitz?\>|\
>                            \<genereitz?\>)|\
> * ^To:[         ]*To:
> /dev/null
> 
> What is wrong with the above recipe?

# Kill specific email
:0
* ^From:.*(intl\.paypal\.com|\
### ".*" will include *anything* up to "intl....
    	 chaseonline\.chase\.com)|\

* ^Subject:.*(\<penis?\>|\
### same here
    	 \<porn?\>|\
	 \<viagra?\>|\
	 \<watches?\>|\
	 \<xxx?\>|\
	 \<jwseavey?\>|\
	 \<verna?\>|\
	 \<joanreitz?\>|\
	 \<genereitz?\>)|\

### * ^To:[         ]*To:
### you probably mean:
* ^To:[         ]$          ### no recipient including ws

### iianm, your recipe will match *only* a second "To:" after ws and
### mine will match a "To:" that is empty or contains only ws

/dev/null

You may still have a problem with "\<" as I am not quite sure of the
proper function.  

as always, more knowledgable individuals may provide greater insight
and/or corrections  :^)

--

-- 
Patrick Shanahan         Plainfield, Indiana, USA        HOG # US1244711
http://wahoo.no-ip.org     Photo Album:  http://wahoo.no-ip.org/gallery2
Registered Linux User #207535                     <at>  http://counter.li.org

Gmane