public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] procmail+spamassassin user filters
@ 2008-10-14 15:45 David Rioja
  2008-10-14 17:29 ` Willie Wong
  0 siblings, 1 reply; 6+ messages in thread
From: David Rioja @ 2008-10-14 15:45 UTC (permalink / raw
  To: gentoo-user

Hello!
my mail users want to define their own individual antispam rules. I've 
installed procmail in order to pipe messages through spamassassin but I 
can't get it working. This is what I've done:

1.- I created ~/.spamassassin/user_prefs with the following line (just 
for testing):

 add_header all hello_you _TESTS_

2.- I created ~/.procmail with the following contents:

 SHELL=/bin/sh
 MAILDIR=$HOME/.maildir
 DEFAULT=$MAILDIR
 LOGFILE=$MAILDIR/procmail.log

 | spamassassin --prefs-file=$HOME/.spamassassin/user_prefs

 # actually I had a separate rc file named spamassassin.rc with further 
stuff
 # but I've changed it for clearness

3.- I send myself a message: procmail.log echoes its processing but my 
X-Spam-hello_you header is missing.

However, when I pipe an stored message by typing on the shell:

spamassassin < message_file

It returns me the message rewritten with my test header.

Piping to procmail with:

procmail < message_file

Creates another message file but without my text header.

Can anyone guess what am I doing wrong?

Thanks!
 



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] procmail+spamassassin user filters
  2008-10-14 15:45 [gentoo-user] procmail+spamassassin user filters David Rioja
@ 2008-10-14 17:29 ` Willie Wong
  2008-10-15  7:08   ` David Rioja
  0 siblings, 1 reply; 6+ messages in thread
From: Willie Wong @ 2008-10-14 17:29 UTC (permalink / raw
  To: gentoo-user

On Tue, Oct 14, 2008 at 05:45:02PM +0200, Penguin Lover David Rioja squawked:
> 2.- I created ~/.procmail with the following contents:
>
> SHELL=/bin/sh
> MAILDIR=$HOME/.maildir
> DEFAULT=$MAILDIR
> LOGFILE=$MAILDIR/procmail.log
>
> | spamassassin --prefs-file=$HOME/.spamassassin/user_prefs
>

Is that all you have in the recipe? I thought a recipe always begins
with 0: ? From my procmailrc file:

-----------snip---------------
:0fw
| /usr/bin/spamc
----------endsnip-------------

since I use spamc/spamd. f makes it a filter and w waits for the
filter to finish. 

W
-- 
Pintsize: I'm always naked!
Sortir en Pantoufles: up 676 days, 16:08



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] procmail+spamassassin user filters
  2008-10-14 17:29 ` Willie Wong
@ 2008-10-15  7:08   ` David Rioja
  2008-10-15 15:24     ` Willie Wong
  0 siblings, 1 reply; 6+ messages in thread
From: David Rioja @ 2008-10-15  7:08 UTC (permalink / raw
  To: gentoo-user

Willie Wong escribió:
> On Tue, Oct 14, 2008 at 05:45:02PM +0200, Penguin Lover David Rioja squawked:
>   
>> 2.- I created ~/.procmail with the following contents:
>>
>> SHELL=/bin/sh
>> MAILDIR=$HOME/.maildir
>> DEFAULT=$MAILDIR
>> LOGFILE=$MAILDIR/procmail.log
>>
>> | spamassassin --prefs-file=$HOME/.spamassassin/user_prefs
>>
>>     
>
> Is that all you have in the recipe? I thought a recipe always begins
> with 0: ? From my procmailrc file:
>
> -----------snip---------------
> :0fw
> | /usr/bin/spamc
> ----------endsnip-------------
>
> since I use spamc/spamd. f makes it a filter and w waits for the
> filter to finish. 
>
> W
>   
Ok, you win :)

I actually have this on .procmail

 INCLUDERC=$HOME/.spamassassin.rc

instead of that line. In the file .spamassassin.rc I have:

:0fw
| spamassassin --prefs-file=$HOME/.spamassassin/user_prefs




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] procmail+spamassassin user filters
  2008-10-15  7:08   ` David Rioja
@ 2008-10-15 15:24     ` Willie Wong
  2008-10-15 23:20       ` David Wei
  0 siblings, 1 reply; 6+ messages in thread
From: Willie Wong @ 2008-10-15 15:24 UTC (permalink / raw
  To: gentoo-user

On Wed, Oct 15, 2008 at 09:08:49AM +0200, Penguin Lover David Rioja squawked:
> Willie Wong escribi?:
>> On Tue, Oct 14, 2008 at 05:45:02PM +0200, Penguin Lover David Rioja 
>> squawked:
>>   
>>> 2.- I created ~/.procmail with the following contents:
>>>
>>> SHELL=/bin/sh
>>> MAILDIR=$HOME/.maildir
>>> DEFAULT=$MAILDIR
>>> LOGFILE=$MAILDIR/procmail.log
>>>
>>> | spamassassin --prefs-file=$HOME/.spamassassin/user_prefs
>>>
>>>     
>>
>> Is that all you have in the recipe? I thought a recipe always begins
>> with 0: ? From my procmailrc file:
>>
>> -----------snip---------------
>> :0fw
>> | /usr/bin/spamc
>> ----------endsnip-------------
>>
>> since I use spamc/spamd. f makes it a filter and w waits for the
>> filter to finish. 
>> W
>>   
> Ok, you win :)
>
> I actually have this on .procmail
>
> INCLUDERC=$HOME/.spamassassin.rc
>
> instead of that line. In the file .spamassassin.rc I have:
>
> :0fw
> | spamassassin --prefs-file=$HOME/.spamassassin/user_prefs

Another really stupid question, when you sayin your .procmail file, do
you mean $HOME/.procmailrc ? I certainly hope you just have a typo,
and not named your file something that procmail does not know is the
config file. 

(Was the ~/.maildir/procmail.log log file created?)

I am pretty sure the $HOME in your command should parse properly even
if procmail passes control to a subshell, so there shouldn't be any
reason why your recipe doesn't work. 

W

-- 
"It was real. At least, if it wasn't real, it did support 
them, and as that is what sofas are supposed to do, this, 
by any test that mattered, was a real sofa. "
Sortir en Pantoufles: up 677 days, 13:59



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] procmail+spamassassin user filters
  2008-10-15 15:24     ` Willie Wong
@ 2008-10-15 23:20       ` David Wei
  2008-10-16 11:51         ` David Rioja
  0 siblings, 1 reply; 6+ messages in thread
From: David Wei @ 2008-10-15 23:20 UTC (permalink / raw
  To: gentoo-user

One more tip, the .procmailrc file should belong and only belong to the mail owner user(right 700),procmail refuse to run when the .procmailrc 's right is not properly set on my box.

On Wed, 15 Oct 2008 11:24:34 -0400
Willie Wong <wwong@Princeton.EDU> wrote:

> On Wed, Oct 15, 2008 at 09:08:49AM +0200, Penguin Lover David Rioja squawked:
> > Willie Wong escribi?:
> >> On Tue, Oct 14, 2008 at 05:45:02PM +0200, Penguin Lover David Rioja 
> >> squawked:
> >>   
> >>> 2.- I created ~/.procmail with the following contents:
> >>>
> >>> SHELL=/bin/sh
> >>> MAILDIR=$HOME/.maildir
> >>> DEFAULT=$MAILDIR
> >>> LOGFILE=$MAILDIR/procmail.log
> >>>
> >>> | spamassassin --prefs-file=$HOME/.spamassassin/user_prefs
> >>>
> >>>     
> >>
> >> Is that all you have in the recipe? I thought a recipe always begins
> >> with 0: ? From my procmailrc file:
> >>
> >> -----------snip---------------
> >> :0fw
> >> | /usr/bin/spamc
> >> ----------endsnip-------------
> >>
> >> since I use spamc/spamd. f makes it a filter and w waits for the
> >> filter to finish. 
> >> W
> >>   
> > Ok, you win :)
> >
> > I actually have this on .procmail
> >
> > INCLUDERC=$HOME/.spamassassin.rc
> >
> > instead of that line. In the file .spamassassin.rc I have:
> >
> > :0fw
> > | spamassassin --prefs-file=$HOME/.spamassassin/user_prefs
> 
> Another really stupid question, when you sayin your .procmail file, do
> you mean $HOME/.procmailrc ? I certainly hope you just have a typo,
> and not named your file something that procmail does not know is the
> config file. 
> 
> (Was the ~/.maildir/procmail.log log file created?)
> 
> I am pretty sure the $HOME in your command should parse properly even
> if procmail passes control to a subshell, so there shouldn't be any
> reason why your recipe doesn't work. 
> 
> W
> 
> -- 
> "It was real. At least, if it wasn't real, it did support 
> them, and as that is what sofas are supposed to do, this, 
> by any test that mattered, was a real sofa. "
> Sortir en Pantoufles: up 677 days, 13:59
> 


-------------------------------
魏亮 David Wei

您可以通过下面的方式和我联系:
MSN: inadavid@hotmail.com
Gtalk: inadavid@gmail.com
Email: davidwei@newbread.tj.cn



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] procmail+spamassassin user filters
  2008-10-15 23:20       ` David Wei
@ 2008-10-16 11:51         ` David Rioja
  0 siblings, 0 replies; 6+ messages in thread
From: David Rioja @ 2008-10-16 11:51 UTC (permalink / raw
  To: gentoo-user

Hello!

I had did both mistakes you said:

1.- My recipe file was named .procmail instead of .procmailrc
2.- My recipe file had permissions other than 700

Both from an outdated (or mistaken) howto (I've reported it to the author).

Now it's working. Note that the option

--prefs-file=$HOME/.spamassassin/user_prefs

is unnecesary as this is the default path to user_prefs.

Thanks a lot!

David Wei escribió:
> One more tip, the .procmailrc file should belong and only belong to the mail owner user(right 700),procmail refuse to run when the .procmailrc 's right is not properly set on my box.
>
> On Wed, 15 Oct 2008 11:24:34 -0400
> Willie Wong <wwong@Princeton.EDU> wrote:
>
>   
>> On Wed, Oct 15, 2008 at 09:08:49AM +0200, Penguin Lover David Rioja squawked:
>>     
>>> Willie Wong escribi?:
>>>       
>>>> On Tue, Oct 14, 2008 at 05:45:02PM +0200, Penguin Lover David Rioja 
>>>> squawked:
>>>>   
>>>>         
>>>>> 2.- I created ~/.procmail with the following contents:
>>>>>
>>>>> SHELL=/bin/sh
>>>>> MAILDIR=$HOME/.maildir
>>>>> DEFAULT=$MAILDIR
>>>>> LOGFILE=$MAILDIR/procmail.log
>>>>>
>>>>> | spamassassin --prefs-file=$HOME/.spamassassin/user_prefs
>>>>>
>>>>>     
>>>>>           
>>>> Is that all you have in the recipe? I thought a recipe always begins
>>>> with 0: ? From my procmailrc file:
>>>>
>>>> -----------snip---------------
>>>> :0fw
>>>> | /usr/bin/spamc
>>>> ----------endsnip-------------
>>>>
>>>> since I use spamc/spamd. f makes it a filter and w waits for the
>>>> filter to finish. 
>>>> W
>>>>   
>>>>         
>>> Ok, you win :)
>>>
>>> I actually have this on .procmail
>>>
>>> INCLUDERC=$HOME/.spamassassin.rc
>>>
>>> instead of that line. In the file .spamassassin.rc I have:
>>>
>>> :0fw
>>> | spamassassin --prefs-file=$HOME/.spamassassin/user_prefs
>>>       
>> Another really stupid question, when you sayin your .procmail file, do
>> you mean $HOME/.procmailrc ? I certainly hope you just have a typo,
>> and not named your file something that procmail does not know is the
>> config file. 
>>
>> (Was the ~/.maildir/procmail.log log file created?)
>>
>> I am pretty sure the $HOME in your command should parse properly even
>> if procmail passes control to a subshell, so there shouldn't be any
>> reason why your recipe doesn't work. 
>>
>> W
>>
>> -- 
>> "It was real. At least, if it wasn't real, it did support 
>> them, and as that is what sofas are supposed to do, this, 
>> by any test that mattered, was a real sofa. "
>> Sortir en Pantoufles: up 677 days, 13:59
>>
>>     
>
>
> -------------------------------
> 魏亮 David Wei
>
> 您可以通过下面的方式和我联系:
> MSN: inadavid@hotmail.com
> Gtalk: inadavid@gmail.com
> Email: davidwei@newbread.tj.cn
>
>
>
>   

-- 
David Rioja Redondo
Tel. (34) 91 675 14 29
Fax: (34) 91 656 91 89




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-10-16 11:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-14 15:45 [gentoo-user] procmail+spamassassin user filters David Rioja
2008-10-14 17:29 ` Willie Wong
2008-10-15  7:08   ` David Rioja
2008-10-15 15:24     ` Willie Wong
2008-10-15 23:20       ` David Wei
2008-10-16 11:51         ` David Rioja

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox