You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Mester <me...@freemail.hu> on 2009/05/21 23:00:09 UTC

spamassassin runs razor spamc not

Hi,

I have a Debian 5.0 server with postfix, amavis-new, spamassassin and razor.

For some reason razor check only runs if I run the following command
spamassassin < /tmp/test.txt

But if I receive an e-mail from outside the server, or start the 
following command
spamc < /tmp/test.txt
razor check do not starts.

What can be the problem?


Attila Mesterhazy

Re: spamassassin runs razor spamc not

Posted by Bowie Bailey <Bo...@BUC.com>.
Jeff Mincy wrote:
>    From: Mester <me...@freemail.hu>
>    Date: Fri, 22 May 2009 14:52:08 +0200
>    
>    >>> Check in the ~/.spamassassin/user_prefs file for the user that runs
>    >>> amavisd-new.  I know the Mandriva package has that set to 'use_razor2
>    >>> 0', so I always have to hunt it down and fix it.
>    >> I had no use_razor2 line in the ~amavis/.spamassassin/user_prefs file
>    >> but after appending these lines to the file:
>    >> use_razor2
>    >> razor_config /var/lib/amavis/.razor/razor-agent.conf
>    >> and restarting both amavis and spamassassin nothig has changed.
>    > 
>    > Then, you need to run some of the amavisd-new debugs
>    > 
>    > I believe the syntax is
>    > 
>    > [amavisd@foo]$ /usr/sbin/amavisd debug-sa plugin
>    
>    It worked. And now I found the error: amavis user couldn't read the 
>    /var/log/razor-agent.log file. I modified the owner of that file to 
>    amavis and now I see the check lines in that file.
>    
>    Is there a way to instruct spamassassin to write the razor, pyzor and 
>    dcc check's result to every e-mail's header an not only for spams?
>
> SpamAssassin has add_header that can be used for Pyzor and DCC.
>
>   add_header all Pyzor _PYZOR_
>   add_header all DCC _DCCB_; _DCCR_
>
> I don't know how headers are added in amavis.
> -jeff
>   

Amavis has its own routines for adding headers.  You'll have to look at 
the Amavis config.

-- 
Bowie

Re: spamassassin runs razor spamc not

Posted by Jeff Mincy <je...@delphioutpost.com>.
   From: Mester <me...@freemail.hu>
   Date: Fri, 22 May 2009 14:52:08 +0200
   
   >>> Check in the ~/.spamassassin/user_prefs file for the user that runs
   >>> amavisd-new.  I know the Mandriva package has that set to 'use_razor2
   >>> 0', so I always have to hunt it down and fix it.
   >> I had no use_razor2 line in the ~amavis/.spamassassin/user_prefs file
   >> but after appending these lines to the file:
   >> use_razor2
   >> razor_config /var/lib/amavis/.razor/razor-agent.conf
   >> and restarting both amavis and spamassassin nothig has changed.
   > 
   > Then, you need to run some of the amavisd-new debugs
   > 
   > I believe the syntax is
   > 
   > [amavisd@foo]$ /usr/sbin/amavisd debug-sa plugin
   
   It worked. And now I found the error: amavis user couldn't read the 
   /var/log/razor-agent.log file. I modified the owner of that file to 
   amavis and now I see the check lines in that file.
   
   Is there a way to instruct spamassassin to write the razor, pyzor and 
   dcc check's result to every e-mail's header an not only for spams?

SpamAssassin has add_header that can be used for Pyzor and DCC.

  add_header all Pyzor _PYZOR_
  add_header all DCC _DCCB_; _DCCR_

I don't know how headers are added in amavis.
-jeff

Re: spamassassin runs razor spamc not

Posted by Mester <me...@freemail.hu>.
>>> Check in the ~/.spamassassin/user_prefs file for the user that runs
>>> amavisd-new.  I know the Mandriva package has that set to 'use_razor2
>>> 0', so I always have to hunt it down and fix it.
>> I had no use_razor2 line in the ~amavis/.spamassassin/user_prefs file
>> but after appending these lines to the file:
>> use_razor2
>> razor_config /var/lib/amavis/.razor/razor-agent.conf
>> and restarting both amavis and spamassassin nothig has changed.
> 
> Then, you need to run some of the amavisd-new debugs
> 
> I believe the syntax is
> 
> [amavisd@foo]$ /usr/sbin/amavisd debug-sa plugin
> 

It worked. And now I found the error: amavis user couldn't read the 
/var/log/razor-agent.log file. I modified the owner of that file to 
amavis and now I see the check lines in that file.

Is there a way to instruct spamassassin to write the razor, pyzor and 
dcc check's result to every e-mail's header an not only for spams?


Attila Mesterhazy

Re: spamassassin runs razor spamc not

Posted by "McDonald, Dan" <Da...@austinenergy.com>.
On Fri, 2009-05-22 at 13:55 +0200, Mester wrote:
> > Check in the ~/.spamassassin/user_prefs file for the user that runs
> > amavisd-new.  I know the Mandriva package has that set to 'use_razor2
> > 0', so I always have to hunt it down and fix it.
> 
> I had no use_razor2 line in the ~amavis/.spamassassin/user_prefs file
> but after appending these lines to the file:
> use_razor2
> razor_config /var/lib/amavis/.razor/razor-agent.conf
> and restarting both amavis and spamassassin nothig has changed.

Then, you need to run some of the amavisd-new debugs

I believe the syntax is

[amavisd@foo]$ /usr/sbin/amavisd debug-sa plugin

-- 
Daniel J McDonald, CCIE # 2495, CISSP # 78281, CNX
www.austinenergy.com

Re: spamassassin runs razor spamc not

Posted by Mester <me...@freemail.hu>.
> Check in the ~/.spamassassin/user_prefs file for the user that runs
> amavisd-new.  I know the Mandriva package has that set to 'use_razor2
> 0', so I always have to hunt it down and fix it.

I had no use_razor2 line in the ~amavis/.spamassassin/user_prefs file
but after appending these lines to the file:
use_razor2
razor_config /var/lib/amavis/.razor/razor-agent.conf
and restarting both amavis and spamassassin nothig has changed.


Attila Mesterhazy



Re: spamassassin runs razor spamc not

Posted by "McDonald, Dan" <Da...@austinenergy.com>.
On Fri, 2009-05-22 at 10:56 +0200, Karsten Bräckelmann wrote:
> On Fri, 2009-05-22 at 08:00 +0200, Mester wrote:

> > > You did enable razor in the server-wide config, right? Not per-user
> > > settings.
> > 
> > I have enabled razor this way:
> > 
> > I have this lines in my /etc/spamassassin/local.cf
> > #razor
> > use_razor2 1
> > razor_config /etc/razor/razor-agent.conf
> > 
> > I also have this line in /etc/spamassassin/v310.pre
> > loadplugin Mail::SpamAssassin::Plugin::Razor2
> > 
> > It should be enough according to many HOW-TOs. Or should I enable Razor 
> > in some Amavis-new config file? If yes where and how?

Check in the ~/.spamassassin/user_prefs file for the user that runs
amavisd-new.  I know the Mandriva package has that set to 'use_razor2
0', so I always have to hunt it down and fix it.


> Sorry, don't know details about Amavis. But it doesn't happen to be
> configured to run without network tests or something?

That's an option in /etc/amavis/amavisd.conf - grep -P for
local.{0,6}only (sorry, I don't recall the precise variable name).  But
you would be complaining about a lot more than razor being toast if you
had it in local-only mode.

-- 
Daniel J McDonald, CCIE # 2495, CISSP # 78281, CNX
www.austinenergy.com

Re: spamassassin runs razor spamc not

Posted by Mester <me...@freemail.hu>.
>>> You did enable razor in the server-wide config, right? Not per-user
>>> settings.
>> I have enabled razor this way:
>>
>> I have this lines in my /etc/spamassassin/local.cf
>> #razor
>> use_razor2 1
>> razor_config /etc/razor/razor-agent.conf
>>
>> I also have this line in /etc/spamassassin/v310.pre
>> loadplugin Mail::SpamAssassin::Plugin::Razor2
>>
>> It should be enough according to many HOW-TOs. Or should I enable Razor 
>> in some Amavis-new config file? If yes where and how?
> 
> Sorry, don't know details about Amavis. But it doesn't happen to be
> configured to run without network tests or something?

I have $sa_local_tests_only = 0, so it should run every tests.

> Since running 'spamassassin' does use Razor, but Amavis does not, I'd go
> check the Amavis configuration.

But what should I look for?

> BTW, how did you verify Amavis doesn't use Razor? And spamassassin does?

After running spamassassin < /tmp/test.txt command I see a new line in 
the /var/log/razor-agent.log file, but aftere receiving mail through 
amavis or running spamc < /tmp/test.txt command there are no new lines 
in that file.


Attila Mesterhazy

> 
> 


Re: spamassassin runs razor spamc not

Posted by Karsten Bräckelmann <gu...@rudersport.de>.
On Fri, 2009-05-22 at 08:00 +0200, Mester wrote:
> >> I have a Debian 5.0 server with postfix, amavis-new, spamassassin and razor.
> > Amavis implements it's own SA daemon, it does not use spamd. So there's
> > a third variable in the equation.
> 
> So do I need spamassassin at all?

Err, you will need SpamAssassin. ;)  Then there's 'spamassassin', a Perl
script to invoke a fresh SA on an ad-hoc basis, and 'spamd', the SA
daemon along with it's light-weight client 'spamc'.

Depending on your distro, packager or source, there might be a lot of
variation how these are split up. If you got a dedicated spamd package,
you won't need that. But you definitely will need all the SA Perl stuff.

Amavis just implements its own daemon using the Perl libs, effectively
replacing spamd only.


> >> For some reason razor check only runs if I run the following command
> >> spamassassin < /tmp/test.txt
> > This picks up any recent changes, server-wide and user specific.
> 
> >> But if I receive an e-mail from outside the server, or start the 
> >> following command
> >> spamc < /tmp/test.txt
> >> razor check do not starts.
> > spamc uses spamd, which needs to be restarted after server-wide changes.
> > Anyway, you don't use it but Amavis. Which also needs to be restarted,
> > after server-wide changes...
> 
> I have restarted the whole system after configuring everything.

That should take care of it indeed.

> >> What can be the problem?
> > You did not restart Amavis after enabling razor? You did not restart
> > spamd? Well, you don't use it, so disable it.
> 
> Should I disable spamassassin?

If by that you mean the system service, and that service actually starts
the spamd daemon -- yeah, you won't need that.


> > You did enable razor in the server-wide config, right? Not per-user
> > settings.
> 
> I have enabled razor this way:
> 
> I have this lines in my /etc/spamassassin/local.cf
> #razor
> use_razor2 1
> razor_config /etc/razor/razor-agent.conf
> 
> I also have this line in /etc/spamassassin/v310.pre
> loadplugin Mail::SpamAssassin::Plugin::Razor2
> 
> It should be enough according to many HOW-TOs. Or should I enable Razor 
> in some Amavis-new config file? If yes where and how?

Sorry, don't know details about Amavis. But it doesn't happen to be
configured to run without network tests or something?

Since running 'spamassassin' does use Razor, but Amavis does not, I'd go
check the Amavis configuration.

BTW, how did you verify Amavis doesn't use Razor? And spamassassin does?


-- 
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: spamassassin runs razor spamc not

Posted by Mester <me...@freemail.hu>.
>> I have a Debian 5.0 server with postfix, amavis-new, spamassassin and razor.
> Amavis implements it's own SA daemon, it does not use spamd. So there's
> a third variable in the equation.

So do I need spamassassin at all?

>> For some reason razor check only runs if I run the following command
>> spamassassin < /tmp/test.txt
> This picks up any recent changes, server-wide and user specific.

>> But if I receive an e-mail from outside the server, or start the 
>> following command
>> spamc < /tmp/test.txt
>> razor check do not starts.
> spamc uses spamd, which needs to be restarted after server-wide changes.
> Anyway, you don't use it but Amavis. Which also needs to be restarted,
> after server-wide changes...

I have restarted the whole system after configuring everything.

>> What can be the problem?
> You did not restart Amavis after enabling razor? You did not restart
> spamd? Well, you don't use it, so disable it.

Should I disable spamassassin?

> You did enable razor in the server-wide config, right? Not per-user
> settings.

I have enabled razor this way:

I have this lines in my /etc/spamassassin/local.cf
#razor
use_razor2 1
razor_config /etc/razor/razor-agent.conf

I also have this line in /etc/spamassassin/v310.pre
loadplugin Mail::SpamAssassin::Plugin::Razor2

It should be enough according to many HOW-TOs. Or should I enable Razor 
in some Amavis-new config file? If yes where and how?


Attila Mesterhazy

Re: spamassassin runs razor spamc not

Posted by Karsten Bräckelmann <gu...@rudersport.de>.
On Thu, 2009-05-21 at 23:00 +0200, Mester wrote:
> Hi,
> 
> I have a Debian 5.0 server with postfix, amavis-new, spamassassin and razor.

Amavis implements it's own SA daemon, it does not use spamd. So there's
a third variable in the equation.

> For some reason razor check only runs if I run the following command
> spamassassin < /tmp/test.txt

This picks up any recent changes, server-wide and user specific.

> But if I receive an e-mail from outside the server, or start the 
> following command
> spamc < /tmp/test.txt
> razor check do not starts.

spamc uses spamd, which needs to be restarted after server-wide changes.
Anyway, you don't use it but Amavis. Which also needs to be restarted,
after server-wide changes...

> What can be the problem?

You did not restart Amavis after enabling razor? You did not restart
spamd? Well, you don't use it, so disable it.

You did enable razor in the server-wide config, right? Not per-user
settings.


-- 
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; }}}