You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Raymond Jette <rj...@mestek.com> on 2013/09/09 01:55:08 UTC

Rules not working

When I add add custom rules to /etc/mail/spamassassin/local.cf the rules work as expected.  If I create any *.cf file and put the rules in they do not work.  My test rule is:

body     test_match_all     /.*/
score    test_match_all     -0.01

Rules only work if they are in local.cf.  If I run the following command:

echo | spamassassin --debug 

I can see my custom rules that are in files other than local.cf get called.  Why would they work this way but never get called when spamd is called from exim?

Thanks for any help you can provide,
Ray

Re: Rules not working

Posted by jdow <jd...@earthlink.net>.
I mention the potential alternate path because it may go through spamd
again but skipped when prior markups indicate it's already been scored.
I remember this tripping some people up in the distant past.

{^_^}

On 2013/09/08 19:26, Raymond Jette wrote:
> It is going through spamd I can see that.  The -u option is not being used.  Thanks for the help.  I'm going to keep working at this.
> ________________________________________
> From: jdow [jdow@earthlink.net]
> Sent: Sunday, September 08, 2013 10:19 PM
> To: users@spamassassin.apache.org
> Subject: Re: Rules not working
>
> That offers a REALLY strong hint that you're not really going the
> spamc/spamd route from exim. As it happens I use bog standard sendmail.
> Sendmail calls procmail. Procmail calls spamassassin via spamc. Procmail
> does NOT daemonize spamassassin. Many other tools that perform similar
> functions to procmail do effectively daemonize spamassassin.
>
> You also might check if spamc is run with a -u flag (or equivalent -
> see "man spamc" or "spamc --help"). If it is recheck that the a.cf file
> can be read as that user. You might be being blocked at the /etc/mail
> directory or /etc/mail/spamassassin directory with a lack of an x flag
> for the declared spamc username.
>
> (ALWAYS, repeat ALWAYS, test spamassassin as a user not as root. That
> way permissions don't foul you up.)
>
> I realize you've checked permissions. I'm just thinking about how I manage
> to find things by just going over and over the same ground trying to look
> deeper each time.
>
> {^_^}
>
> On 2013/09/08 18:36, Raymond Jette wrote:
>> The following lines also show a test rule hitting:
>>
>> [root@mx1 rjette]# cat mailflow.txt  | grep match_
>> Sep  8 21:31:47.662 [10285] dbg: rules: ran body rule match_all ======> got hit: "negative match"
>> Sep  8 21:31:48.116 [10285] dbg: check: tests=DKIM_ADSP_NXDOMAIN,MISSING_DATE,MISSING_HEADERS,MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS,match_all
>> Sep  8 21:31:55.091 [10288] dbg: rules: ran body rule match_all ======> got hit: "Rodney Martha Clephane Adkins commented on your status."
>> Sep  8 21:31:56.061 [10288] dbg: check: tests=DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,match_all
>> Sep  8 21:31:56.064 [10288] info: spamd: result: . 0 - DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,match_all scantime=1.4,size=11207,user=nobody,uid=99,required_score=6.0,rhost=localhost.localdomain,raddr=127.0.0.1,rport=45086,mid=<b4...@graph.facebook.com>,autolearn=unavailable
>>
>>
>> It appears to hit here but not on real mail.  Any ideas?
>> ________________________________________
>> From: jdow [jdow@earthlink.net]
>> Sent: Sunday, September 08, 2013 9:20 PM
>> To: users@spamassassin.apache.org
>> Subject: Re: Rules not working
>>
>> Have you generated said debug output by running spamd with the -D flag?
>> That is the debug output that matters. Also run spamassassin -D as a
>> bog standard user rather than root.
>>
>> To minimize interruptions to mail flow I'd test it this way:
>>
>> stop spamd
>>
>> manually start spamd with the -D flag as well as all the other usual flags
>> and values.
>>
>> Run tests through it using regular mail and a manual "spamc".
>>
>> Stop the -D spamd.
>>
>> Restart the normal spamd.
>>
>> This should only take a minute or two.
>>
>> {^_^}
>>
>>
>> On 2013/09/08 18:09, Raymond Jette wrote:
>>> Yes.  The permissions are correct.  Yes, the debug output shows that the files and rules were found and matched against the test message.
>>> ________________________________________
>>> From: jdow [jdow@earthlink.net]
>>> Sent: Sunday, September 08, 2013 9:01 PM
>>> To: users@spamassassin.apache.org
>>> Subject: Re: Rules not working
>>>
>>> Did you set permissions? (-rw-r--r--)
>>>
>>> Are there any signs in the debug output that the files were even found at all?
>>> Whatever it is that actually calls spamd or uses spamassassin internally may
>>> do something to direct it off into left field.
>>>
>>> {^_^}
>>>
>>> On 2013/09/08 17:23, Raymond Jette wrote:
>>>> Yes.  I restarted everything.  When this did not work I rebooted the server.  This still did not help.
>>>> ________________________________________
>>>> From: jdow [jdow@earthlink.net]
>>>> Sent: Sunday, September 08, 2013 8:21 PM
>>>> To: users@spamassassin.apache.org
>>>> Subject: Re: Rules not working
>>>>
>>>> On 2013/09/08 16:55, Raymond Jette wrote:
>>>>> When I add add custom rules to /etc/mail/spamassassin/local.cf the rules work as expected.  If I create any *.cf file and put the rules in they do not work.  My test rule is:
>>>>>
>>>>> body     test_match_all     /.*/
>>>>> score    test_match_all     -0.01
>>>>>
>>>>> Rules only work if they are in local.cf.  If I run the following command:
>>>>>
>>>>> echo | spamassassin --debug
>>>>>
>>>>> I can see my custom rules that are in files other than local.cf get called.  Why would they work this way but never get called when spamd is called from exim?
>>>>>
>>>>> Thanks for any help you can provide,
>>>>> Ray
>>>>
>>>> Did you restart spamassassin or the tool that uses spamassassin itself?
>>>>
>>>> {^_^}
>>>>
>>>>
>>>
>>
>

RE: Rules not working

Posted by Raymond Jette <rj...@mestek.com>.
It is going through spamd I can see that.  The -u option is not being used.  Thanks for the help.  I'm going to keep working at this.
________________________________________
From: jdow [jdow@earthlink.net]
Sent: Sunday, September 08, 2013 10:19 PM
To: users@spamassassin.apache.org
Subject: Re: Rules not working

That offers a REALLY strong hint that you're not really going the
spamc/spamd route from exim. As it happens I use bog standard sendmail.
Sendmail calls procmail. Procmail calls spamassassin via spamc. Procmail
does NOT daemonize spamassassin. Many other tools that perform similar
functions to procmail do effectively daemonize spamassassin.

You also might check if spamc is run with a -u flag (or equivalent -
see "man spamc" or "spamc --help"). If it is recheck that the a.cf file
can be read as that user. You might be being blocked at the /etc/mail
directory or /etc/mail/spamassassin directory with a lack of an x flag
for the declared spamc username.

(ALWAYS, repeat ALWAYS, test spamassassin as a user not as root. That
way permissions don't foul you up.)

I realize you've checked permissions. I'm just thinking about how I manage
to find things by just going over and over the same ground trying to look
deeper each time.

{^_^}

On 2013/09/08 18:36, Raymond Jette wrote:
> The following lines also show a test rule hitting:
>
> [root@mx1 rjette]# cat mailflow.txt  | grep match_
> Sep  8 21:31:47.662 [10285] dbg: rules: ran body rule match_all ======> got hit: "negative match"
> Sep  8 21:31:48.116 [10285] dbg: check: tests=DKIM_ADSP_NXDOMAIN,MISSING_DATE,MISSING_HEADERS,MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS,match_all
> Sep  8 21:31:55.091 [10288] dbg: rules: ran body rule match_all ======> got hit: "Rodney Martha Clephane Adkins commented on your status."
> Sep  8 21:31:56.061 [10288] dbg: check: tests=DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,match_all
> Sep  8 21:31:56.064 [10288] info: spamd: result: . 0 - DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,match_all scantime=1.4,size=11207,user=nobody,uid=99,required_score=6.0,rhost=localhost.localdomain,raddr=127.0.0.1,rport=45086,mid=<b4...@graph.facebook.com>,autolearn=unavailable
>
>
> It appears to hit here but not on real mail.  Any ideas?
> ________________________________________
> From: jdow [jdow@earthlink.net]
> Sent: Sunday, September 08, 2013 9:20 PM
> To: users@spamassassin.apache.org
> Subject: Re: Rules not working
>
> Have you generated said debug output by running spamd with the -D flag?
> That is the debug output that matters. Also run spamassassin -D as a
> bog standard user rather than root.
>
> To minimize interruptions to mail flow I'd test it this way:
>
> stop spamd
>
> manually start spamd with the -D flag as well as all the other usual flags
> and values.
>
> Run tests through it using regular mail and a manual "spamc".
>
> Stop the -D spamd.
>
> Restart the normal spamd.
>
> This should only take a minute or two.
>
> {^_^}
>
>
> On 2013/09/08 18:09, Raymond Jette wrote:
>> Yes.  The permissions are correct.  Yes, the debug output shows that the files and rules were found and matched against the test message.
>> ________________________________________
>> From: jdow [jdow@earthlink.net]
>> Sent: Sunday, September 08, 2013 9:01 PM
>> To: users@spamassassin.apache.org
>> Subject: Re: Rules not working
>>
>> Did you set permissions? (-rw-r--r--)
>>
>> Are there any signs in the debug output that the files were even found at all?
>> Whatever it is that actually calls spamd or uses spamassassin internally may
>> do something to direct it off into left field.
>>
>> {^_^}
>>
>> On 2013/09/08 17:23, Raymond Jette wrote:
>>> Yes.  I restarted everything.  When this did not work I rebooted the server.  This still did not help.
>>> ________________________________________
>>> From: jdow [jdow@earthlink.net]
>>> Sent: Sunday, September 08, 2013 8:21 PM
>>> To: users@spamassassin.apache.org
>>> Subject: Re: Rules not working
>>>
>>> On 2013/09/08 16:55, Raymond Jette wrote:
>>>> When I add add custom rules to /etc/mail/spamassassin/local.cf the rules work as expected.  If I create any *.cf file and put the rules in they do not work.  My test rule is:
>>>>
>>>> body     test_match_all     /.*/
>>>> score    test_match_all     -0.01
>>>>
>>>> Rules only work if they are in local.cf.  If I run the following command:
>>>>
>>>> echo | spamassassin --debug
>>>>
>>>> I can see my custom rules that are in files other than local.cf get called.  Why would they work this way but never get called when spamd is called from exim?
>>>>
>>>> Thanks for any help you can provide,
>>>> Ray
>>>
>>> Did you restart spamassassin or the tool that uses spamassassin itself?
>>>
>>> {^_^}
>>>
>>>
>>
>

Re: Rules not working

Posted by jdow <jd...@earthlink.net>.
That offers a REALLY strong hint that you're not really going the
spamc/spamd route from exim. As it happens I use bog standard sendmail.
Sendmail calls procmail. Procmail calls spamassassin via spamc. Procmail
does NOT daemonize spamassassin. Many other tools that perform similar
functions to procmail do effectively daemonize spamassassin.

You also might check if spamc is run with a -u flag (or equivalent -
see "man spamc" or "spamc --help"). If it is recheck that the a.cf file
can be read as that user. You might be being blocked at the /etc/mail
directory or /etc/mail/spamassassin directory with a lack of an x flag
for the declared spamc username.

(ALWAYS, repeat ALWAYS, test spamassassin as a user not as root. That
way permissions don't foul you up.)

I realize you've checked permissions. I'm just thinking about how I manage
to find things by just going over and over the same ground trying to look
deeper each time.

{^_^}

On 2013/09/08 18:36, Raymond Jette wrote:
> The following lines also show a test rule hitting:
>
> [root@mx1 rjette]# cat mailflow.txt  | grep match_
> Sep  8 21:31:47.662 [10285] dbg: rules: ran body rule match_all ======> got hit: "negative match"
> Sep  8 21:31:48.116 [10285] dbg: check: tests=DKIM_ADSP_NXDOMAIN,MISSING_DATE,MISSING_HEADERS,MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS,match_all
> Sep  8 21:31:55.091 [10288] dbg: rules: ran body rule match_all ======> got hit: "Rodney Martha Clephane Adkins commented on your status."
> Sep  8 21:31:56.061 [10288] dbg: check: tests=DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,match_all
> Sep  8 21:31:56.064 [10288] info: spamd: result: . 0 - DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,match_all scantime=1.4,size=11207,user=nobody,uid=99,required_score=6.0,rhost=localhost.localdomain,raddr=127.0.0.1,rport=45086,mid=<b4...@graph.facebook.com>,autolearn=unavailable
>
>
> It appears to hit here but not on real mail.  Any ideas?
> ________________________________________
> From: jdow [jdow@earthlink.net]
> Sent: Sunday, September 08, 2013 9:20 PM
> To: users@spamassassin.apache.org
> Subject: Re: Rules not working
>
> Have you generated said debug output by running spamd with the -D flag?
> That is the debug output that matters. Also run spamassassin -D as a
> bog standard user rather than root.
>
> To minimize interruptions to mail flow I'd test it this way:
>
> stop spamd
>
> manually start spamd with the -D flag as well as all the other usual flags
> and values.
>
> Run tests through it using regular mail and a manual "spamc".
>
> Stop the -D spamd.
>
> Restart the normal spamd.
>
> This should only take a minute or two.
>
> {^_^}
>
>
> On 2013/09/08 18:09, Raymond Jette wrote:
>> Yes.  The permissions are correct.  Yes, the debug output shows that the files and rules were found and matched against the test message.
>> ________________________________________
>> From: jdow [jdow@earthlink.net]
>> Sent: Sunday, September 08, 2013 9:01 PM
>> To: users@spamassassin.apache.org
>> Subject: Re: Rules not working
>>
>> Did you set permissions? (-rw-r--r--)
>>
>> Are there any signs in the debug output that the files were even found at all?
>> Whatever it is that actually calls spamd or uses spamassassin internally may
>> do something to direct it off into left field.
>>
>> {^_^}
>>
>> On 2013/09/08 17:23, Raymond Jette wrote:
>>> Yes.  I restarted everything.  When this did not work I rebooted the server.  This still did not help.
>>> ________________________________________
>>> From: jdow [jdow@earthlink.net]
>>> Sent: Sunday, September 08, 2013 8:21 PM
>>> To: users@spamassassin.apache.org
>>> Subject: Re: Rules not working
>>>
>>> On 2013/09/08 16:55, Raymond Jette wrote:
>>>> When I add add custom rules to /etc/mail/spamassassin/local.cf the rules work as expected.  If I create any *.cf file and put the rules in they do not work.  My test rule is:
>>>>
>>>> body     test_match_all     /.*/
>>>> score    test_match_all     -0.01
>>>>
>>>> Rules only work if they are in local.cf.  If I run the following command:
>>>>
>>>> echo | spamassassin --debug
>>>>
>>>> I can see my custom rules that are in files other than local.cf get called.  Why would they work this way but never get called when spamd is called from exim?
>>>>
>>>> Thanks for any help you can provide,
>>>> Ray
>>>
>>> Did you restart spamassassin or the tool that uses spamassassin itself?
>>>
>>> {^_^}
>>>
>>>
>>
>

Re: Rules not working

Posted by Karsten Bräckelmann <gu...@rudersport.de>.
On Mon, 2013-09-09 at 01:36 +0000, Raymond Jette wrote:
> The following lines also show a test rule hitting:

One important thing I noticed missing from this thread is any evidence
that custom rules are not working. This is pretty important to get a
better picture of your issue and environment.

How exactly do you tell your custom rules are not working?


> [root@mx1 rjette]# cat mailflow.txt  | grep match_
> Sep  8 21:31:47.662 [10285] dbg: rules: ran body rule match_all ======> got hit: "negative match"
> Sep  8 21:31:48.116 [10285] dbg: check: tests=DKIM_ADSP_NXDOMAIN,MISSING_DATE,MISSING_HEADERS,MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS,match_all

Whatever that was you passed through, it was not a mail. The following
one looks good, though.

> Sep  8 21:31:55.091 [10288] dbg: rules: ran body rule match_all ======> got hit: "Rodney Martha Clephane Adkins commented on your status."
> Sep  8 21:31:56.061 [10288] dbg: check: tests=DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,match_all
> Sep  8 21:31:56.064 [10288] info: spamd: result: . 0 - DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,match_all scantime=1.4,size=11207,user=nobody,uid=99,required_score=6.0,rhost=localhost.localdomain,raddr=127.0.0.1,rport=45086,mid=<b4...@graph.facebook.com>,autolearn=unavailable
> 
> It appears to hit here but not on real mail.  Any ideas?

This is getting slightly confusing. The original issue was custom rules
working if defined in local.cf, but not in custom cf files. Now you are
saying your custom rules work in debug mode, but not with "real mail".

By that, are you referring to not using debug mode, or a substantially
different method of passing mail to your testing environment versus
production system?


-- 
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: Rules not working

Posted by Raymond Jette <rj...@mestek.com>.
The following lines also show a test rule hitting:

[root@mx1 rjette]# cat mailflow.txt  | grep match_
Sep  8 21:31:47.662 [10285] dbg: rules: ran body rule match_all ======> got hit: "negative match"
Sep  8 21:31:48.116 [10285] dbg: check: tests=DKIM_ADSP_NXDOMAIN,MISSING_DATE,MISSING_HEADERS,MISSING_SUBJECT,NO_RECEIVED,NO_RELAYS,match_all
Sep  8 21:31:55.091 [10288] dbg: rules: ran body rule match_all ======> got hit: "Rodney Martha Clephane Adkins commented on your status."
Sep  8 21:31:56.061 [10288] dbg: check: tests=DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,match_all
Sep  8 21:31:56.064 [10288] info: spamd: result: . 0 - DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,match_all scantime=1.4,size=11207,user=nobody,uid=99,required_score=6.0,rhost=localhost.localdomain,raddr=127.0.0.1,rport=45086,mid=<b4...@graph.facebook.com>,autolearn=unavailable


It appears to hit here but not on real mail.  Any ideas?
________________________________________
From: jdow [jdow@earthlink.net]
Sent: Sunday, September 08, 2013 9:20 PM
To: users@spamassassin.apache.org
Subject: Re: Rules not working

Have you generated said debug output by running spamd with the -D flag?
That is the debug output that matters. Also run spamassassin -D as a
bog standard user rather than root.

To minimize interruptions to mail flow I'd test it this way:

stop spamd

manually start spamd with the -D flag as well as all the other usual flags
and values.

Run tests through it using regular mail and a manual "spamc".

Stop the -D spamd.

Restart the normal spamd.

This should only take a minute or two.

{^_^}


On 2013/09/08 18:09, Raymond Jette wrote:
> Yes.  The permissions are correct.  Yes, the debug output shows that the files and rules were found and matched against the test message.
> ________________________________________
> From: jdow [jdow@earthlink.net]
> Sent: Sunday, September 08, 2013 9:01 PM
> To: users@spamassassin.apache.org
> Subject: Re: Rules not working
>
> Did you set permissions? (-rw-r--r--)
>
> Are there any signs in the debug output that the files were even found at all?
> Whatever it is that actually calls spamd or uses spamassassin internally may
> do something to direct it off into left field.
>
> {^_^}
>
> On 2013/09/08 17:23, Raymond Jette wrote:
>> Yes.  I restarted everything.  When this did not work I rebooted the server.  This still did not help.
>> ________________________________________
>> From: jdow [jdow@earthlink.net]
>> Sent: Sunday, September 08, 2013 8:21 PM
>> To: users@spamassassin.apache.org
>> Subject: Re: Rules not working
>>
>> On 2013/09/08 16:55, Raymond Jette wrote:
>>> When I add add custom rules to /etc/mail/spamassassin/local.cf the rules work as expected.  If I create any *.cf file and put the rules in they do not work.  My test rule is:
>>>
>>> body     test_match_all     /.*/
>>> score    test_match_all     -0.01
>>>
>>> Rules only work if they are in local.cf.  If I run the following command:
>>>
>>> echo | spamassassin --debug
>>>
>>> I can see my custom rules that are in files other than local.cf get called.  Why would they work this way but never get called when spamd is called from exim?
>>>
>>> Thanks for any help you can provide,
>>> Ray
>>
>> Did you restart spamassassin or the tool that uses spamassassin itself?
>>
>> {^_^}
>>
>>
>

RE: Rules not working

Posted by Raymond Jette <rj...@mestek.com>.
Yes.  I am using selinux.

-----Original Message-----
From: Benny Pedersen [mailto:me@junc.eu] 
Sent: Monday, September 09, 2013 3:40 AM
To: users@spamassassin.apache.org
Subject: RE: Rules not working

Raymond Jette skrev den 2013-09-09 03:09:
> Yes.  The permissions are correct.  Yes, the debug output shows that 
> the files and rules were found and matched against the test message.

selinux ?



RE: Rules not working

Posted by Benny Pedersen <me...@junc.eu>.
Raymond Jette skrev den 2013-09-09 03:09:
> Yes.  The permissions are correct.  Yes, the debug output shows that
> the files and rules were found and matched against the test message.

selinux ?



Re: Rules not working

Posted by jdow <jd...@earthlink.net>.
Note - your parameters may be different. The "ps -AF" command gives
the right values.

{^_-}

On 2013/09/08 19:16, Raymond Jette wrote:
> Thank you.  I will re-run it with the correct parameters.
> ________________________________________
> From: jdow [jdow@earthlink.net]
> Sent: Sunday, September 08, 2013 10:08 PM
> To: users@spamassassin.apache.org
> Cc: Raymond Jette
> Subject: Re: Rules not working
>
>   > ps -AF | grep spamd
> root     12960     1  0 67331 79068   1 04:10 ?        00:00:09 /usr/bin/spamd
> -d -c -m5 -H -r /var/run/spamd.pid
> ...
>
> {^_^}
>
> On 2013/09/08 18:28, Raymond Jette wrote:
>> I'm sorry but I dont know how to find what other flags I should be using.  spamd is started from systemd in
>>
>> /usr/lib/systemd/system/spamassassin.service
>>
>> This file contains the following:
>>
>> [Unit]
>> Description=Spamassassin daemon
>> After=syslog.target network.target
>>
>> [Service]
>> Type=forking
>> PIDFile=/var/run/spamd.pid
>> EnvironmentFile=-/etc/sysconfig/spamassassin
>> ExecStartPre=-/sbin/portrelease spamd
>> ExecStart=/usr/bin/spamd --pidfile /var/run/spamd.pid $SPAMDOPTIONS
>> StandardOutput=syslog
>> StandardError=syslog
>> Restart=always
>>
>> [Install]
>> WantedBy=multi-user.target
>>
>>
>> Should I test by calling spamd like follows or something else:
>>
>> echo | spamd -D
>>
>> Thanks for the help.
>> ________________________________________
>> From: jdow [jdow@earthlink.net]
>> Sent: Sunday, September 08, 2013 9:20 PM
>> To: users@spamassassin.apache.org
>> Subject: Re: Rules not working
>>
>> Have you generated said debug output by running spamd with the -D flag?
>> That is the debug output that matters. Also run spamassassin -D as a
>> bog standard user rather than root.
>>
>> To minimize interruptions to mail flow I'd test it this way:
>>
>> stop spamd
>>
>> manually start spamd with the -D flag as well as all the other usual flags
>> and values.
>>
>> Run tests through it using regular mail and a manual "spamc".
>>
>> Stop the -D spamd.
>>
>> Restart the normal spamd.
>>
>> This should only take a minute or two.
>>
>> {^_^}
>>
>>
>> On 2013/09/08 18:09, Raymond Jette wrote:
>>> Yes.  The permissions are correct.  Yes, the debug output shows that the files and rules were found and matched against the test message.
>>> ________________________________________
>>> From: jdow [jdow@earthlink.net]
>>> Sent: Sunday, September 08, 2013 9:01 PM
>>> To: users@spamassassin.apache.org
>>> Subject: Re: Rules not working
>>>
>>> Did you set permissions? (-rw-r--r--)
>>>
>>> Are there any signs in the debug output that the files were even found at all?
>>> Whatever it is that actually calls spamd or uses spamassassin internally may
>>> do something to direct it off into left field.
>>>
>>> {^_^}
>>>
>>> On 2013/09/08 17:23, Raymond Jette wrote:
>>>> Yes.  I restarted everything.  When this did not work I rebooted the server.  This still did not help.
>>>> ________________________________________
>>>> From: jdow [jdow@earthlink.net]
>>>> Sent: Sunday, September 08, 2013 8:21 PM
>>>> To: users@spamassassin.apache.org
>>>> Subject: Re: Rules not working
>>>>
>>>> On 2013/09/08 16:55, Raymond Jette wrote:
>>>>> When I add add custom rules to /etc/mail/spamassassin/local.cf the rules work as expected.  If I create any *.cf file and put the rules in they do not work.  My test rule is:
>>>>>
>>>>> body     test_match_all     /.*/
>>>>> score    test_match_all     -0.01
>>>>>
>>>>> Rules only work if they are in local.cf.  If I run the following command:
>>>>>
>>>>> echo | spamassassin --debug
>>>>>
>>>>> I can see my custom rules that are in files other than local.cf get called.  Why would they work this way but never get called when spamd is called from exim?
>>>>>
>>>>> Thanks for any help you can provide,
>>>>> Ray
>>>>
>>>> Did you restart spamassassin or the tool that uses spamassassin itself?
>>>>
>>>> {^_^}
>>>>
>>>>
>>>
>>
>

RE: Rules not working

Posted by Raymond Jette <rj...@mestek.com>.
Thank you.  I will re-run it with the correct parameters.
________________________________________
From: jdow [jdow@earthlink.net]
Sent: Sunday, September 08, 2013 10:08 PM
To: users@spamassassin.apache.org
Cc: Raymond Jette
Subject: Re: Rules not working

 > ps -AF | grep spamd
root     12960     1  0 67331 79068   1 04:10 ?        00:00:09 /usr/bin/spamd
-d -c -m5 -H -r /var/run/spamd.pid
...

{^_^}

On 2013/09/08 18:28, Raymond Jette wrote:
> I'm sorry but I dont know how to find what other flags I should be using.  spamd is started from systemd in
>
> /usr/lib/systemd/system/spamassassin.service
>
> This file contains the following:
>
> [Unit]
> Description=Spamassassin daemon
> After=syslog.target network.target
>
> [Service]
> Type=forking
> PIDFile=/var/run/spamd.pid
> EnvironmentFile=-/etc/sysconfig/spamassassin
> ExecStartPre=-/sbin/portrelease spamd
> ExecStart=/usr/bin/spamd --pidfile /var/run/spamd.pid $SPAMDOPTIONS
> StandardOutput=syslog
> StandardError=syslog
> Restart=always
>
> [Install]
> WantedBy=multi-user.target
>
>
> Should I test by calling spamd like follows or something else:
>
> echo | spamd -D
>
> Thanks for the help.
> ________________________________________
> From: jdow [jdow@earthlink.net]
> Sent: Sunday, September 08, 2013 9:20 PM
> To: users@spamassassin.apache.org
> Subject: Re: Rules not working
>
> Have you generated said debug output by running spamd with the -D flag?
> That is the debug output that matters. Also run spamassassin -D as a
> bog standard user rather than root.
>
> To minimize interruptions to mail flow I'd test it this way:
>
> stop spamd
>
> manually start spamd with the -D flag as well as all the other usual flags
> and values.
>
> Run tests through it using regular mail and a manual "spamc".
>
> Stop the -D spamd.
>
> Restart the normal spamd.
>
> This should only take a minute or two.
>
> {^_^}
>
>
> On 2013/09/08 18:09, Raymond Jette wrote:
>> Yes.  The permissions are correct.  Yes, the debug output shows that the files and rules were found and matched against the test message.
>> ________________________________________
>> From: jdow [jdow@earthlink.net]
>> Sent: Sunday, September 08, 2013 9:01 PM
>> To: users@spamassassin.apache.org
>> Subject: Re: Rules not working
>>
>> Did you set permissions? (-rw-r--r--)
>>
>> Are there any signs in the debug output that the files were even found at all?
>> Whatever it is that actually calls spamd or uses spamassassin internally may
>> do something to direct it off into left field.
>>
>> {^_^}
>>
>> On 2013/09/08 17:23, Raymond Jette wrote:
>>> Yes.  I restarted everything.  When this did not work I rebooted the server.  This still did not help.
>>> ________________________________________
>>> From: jdow [jdow@earthlink.net]
>>> Sent: Sunday, September 08, 2013 8:21 PM
>>> To: users@spamassassin.apache.org
>>> Subject: Re: Rules not working
>>>
>>> On 2013/09/08 16:55, Raymond Jette wrote:
>>>> When I add add custom rules to /etc/mail/spamassassin/local.cf the rules work as expected.  If I create any *.cf file and put the rules in they do not work.  My test rule is:
>>>>
>>>> body     test_match_all     /.*/
>>>> score    test_match_all     -0.01
>>>>
>>>> Rules only work if they are in local.cf.  If I run the following command:
>>>>
>>>> echo | spamassassin --debug
>>>>
>>>> I can see my custom rules that are in files other than local.cf get called.  Why would they work this way but never get called when spamd is called from exim?
>>>>
>>>> Thanks for any help you can provide,
>>>> Ray
>>>
>>> Did you restart spamassassin or the tool that uses spamassassin itself?
>>>
>>> {^_^}
>>>
>>>
>>
>

Re: Rules not working

Posted by jdow <jd...@earthlink.net>.
 > ps -AF | grep spamd
root     12960     1  0 67331 79068   1 04:10 ?        00:00:09 /usr/bin/spamd 
-d -c -m5 -H -r /var/run/spamd.pid
...

{^_^}

On 2013/09/08 18:28, Raymond Jette wrote:
> I'm sorry but I dont know how to find what other flags I should be using.  spamd is started from systemd in
>
> /usr/lib/systemd/system/spamassassin.service
>
> This file contains the following:
>
> [Unit]
> Description=Spamassassin daemon
> After=syslog.target network.target
>
> [Service]
> Type=forking
> PIDFile=/var/run/spamd.pid
> EnvironmentFile=-/etc/sysconfig/spamassassin
> ExecStartPre=-/sbin/portrelease spamd
> ExecStart=/usr/bin/spamd --pidfile /var/run/spamd.pid $SPAMDOPTIONS
> StandardOutput=syslog
> StandardError=syslog
> Restart=always
>
> [Install]
> WantedBy=multi-user.target
>
>
> Should I test by calling spamd like follows or something else:
>
> echo | spamd -D
>
> Thanks for the help.
> ________________________________________
> From: jdow [jdow@earthlink.net]
> Sent: Sunday, September 08, 2013 9:20 PM
> To: users@spamassassin.apache.org
> Subject: Re: Rules not working
>
> Have you generated said debug output by running spamd with the -D flag?
> That is the debug output that matters. Also run spamassassin -D as a
> bog standard user rather than root.
>
> To minimize interruptions to mail flow I'd test it this way:
>
> stop spamd
>
> manually start spamd with the -D flag as well as all the other usual flags
> and values.
>
> Run tests through it using regular mail and a manual "spamc".
>
> Stop the -D spamd.
>
> Restart the normal spamd.
>
> This should only take a minute or two.
>
> {^_^}
>
>
> On 2013/09/08 18:09, Raymond Jette wrote:
>> Yes.  The permissions are correct.  Yes, the debug output shows that the files and rules were found and matched against the test message.
>> ________________________________________
>> From: jdow [jdow@earthlink.net]
>> Sent: Sunday, September 08, 2013 9:01 PM
>> To: users@spamassassin.apache.org
>> Subject: Re: Rules not working
>>
>> Did you set permissions? (-rw-r--r--)
>>
>> Are there any signs in the debug output that the files were even found at all?
>> Whatever it is that actually calls spamd or uses spamassassin internally may
>> do something to direct it off into left field.
>>
>> {^_^}
>>
>> On 2013/09/08 17:23, Raymond Jette wrote:
>>> Yes.  I restarted everything.  When this did not work I rebooted the server.  This still did not help.
>>> ________________________________________
>>> From: jdow [jdow@earthlink.net]
>>> Sent: Sunday, September 08, 2013 8:21 PM
>>> To: users@spamassassin.apache.org
>>> Subject: Re: Rules not working
>>>
>>> On 2013/09/08 16:55, Raymond Jette wrote:
>>>> When I add add custom rules to /etc/mail/spamassassin/local.cf the rules work as expected.  If I create any *.cf file and put the rules in they do not work.  My test rule is:
>>>>
>>>> body     test_match_all     /.*/
>>>> score    test_match_all     -0.01
>>>>
>>>> Rules only work if they are in local.cf.  If I run the following command:
>>>>
>>>> echo | spamassassin --debug
>>>>
>>>> I can see my custom rules that are in files other than local.cf get called.  Why would they work this way but never get called when spamd is called from exim?
>>>>
>>>> Thanks for any help you can provide,
>>>> Ray
>>>
>>> Did you restart spamassassin or the tool that uses spamassassin itself?
>>>
>>> {^_^}
>>>
>>>
>>
>

RE: Rules not working

Posted by Raymond Jette <rj...@mestek.com>.
I'm sorry but I dont know how to find what other flags I should be using.  spamd is started from systemd in

/usr/lib/systemd/system/spamassassin.service

This file contains the following:

[Unit]
Description=Spamassassin daemon
After=syslog.target network.target

[Service]
Type=forking
PIDFile=/var/run/spamd.pid
EnvironmentFile=-/etc/sysconfig/spamassassin
ExecStartPre=-/sbin/portrelease spamd
ExecStart=/usr/bin/spamd --pidfile /var/run/spamd.pid $SPAMDOPTIONS
StandardOutput=syslog
StandardError=syslog
Restart=always

[Install]
WantedBy=multi-user.target


Should I test by calling spamd like follows or something else:

echo | spamd -D 

Thanks for the help.
________________________________________
From: jdow [jdow@earthlink.net]
Sent: Sunday, September 08, 2013 9:20 PM
To: users@spamassassin.apache.org
Subject: Re: Rules not working

Have you generated said debug output by running spamd with the -D flag?
That is the debug output that matters. Also run spamassassin -D as a
bog standard user rather than root.

To minimize interruptions to mail flow I'd test it this way:

stop spamd

manually start spamd with the -D flag as well as all the other usual flags
and values.

Run tests through it using regular mail and a manual "spamc".

Stop the -D spamd.

Restart the normal spamd.

This should only take a minute or two.

{^_^}


On 2013/09/08 18:09, Raymond Jette wrote:
> Yes.  The permissions are correct.  Yes, the debug output shows that the files and rules were found and matched against the test message.
> ________________________________________
> From: jdow [jdow@earthlink.net]
> Sent: Sunday, September 08, 2013 9:01 PM
> To: users@spamassassin.apache.org
> Subject: Re: Rules not working
>
> Did you set permissions? (-rw-r--r--)
>
> Are there any signs in the debug output that the files were even found at all?
> Whatever it is that actually calls spamd or uses spamassassin internally may
> do something to direct it off into left field.
>
> {^_^}
>
> On 2013/09/08 17:23, Raymond Jette wrote:
>> Yes.  I restarted everything.  When this did not work I rebooted the server.  This still did not help.
>> ________________________________________
>> From: jdow [jdow@earthlink.net]
>> Sent: Sunday, September 08, 2013 8:21 PM
>> To: users@spamassassin.apache.org
>> Subject: Re: Rules not working
>>
>> On 2013/09/08 16:55, Raymond Jette wrote:
>>> When I add add custom rules to /etc/mail/spamassassin/local.cf the rules work as expected.  If I create any *.cf file and put the rules in they do not work.  My test rule is:
>>>
>>> body     test_match_all     /.*/
>>> score    test_match_all     -0.01
>>>
>>> Rules only work if they are in local.cf.  If I run the following command:
>>>
>>> echo | spamassassin --debug
>>>
>>> I can see my custom rules that are in files other than local.cf get called.  Why would they work this way but never get called when spamd is called from exim?
>>>
>>> Thanks for any help you can provide,
>>> Ray
>>
>> Did you restart spamassassin or the tool that uses spamassassin itself?
>>
>> {^_^}
>>
>>
>

RE: Rules not working

Posted by Raymond Jette <rj...@mestek.com>.
Currently I'm using SElinux.  I'll disable it and see what happens.

-----Original Message-----
From: Martin Gregorie [mailto:martin@gregorie.org] 
Sent: Monday, September 09, 2013 11:28 AM
To: users@spamassassin.apache.org
Subject: Re: Rules not working

On Mon, 2013-09-09 at 14:50 +0000, Raymond Jette wrote:
> I just create a new .cf file on my second MTA and I'm having the same 
> problem.  I don't think this is with my systems.  I'm beginning to 
> think it's with the packages in the Fedora repository.  I'm setting up 
> a test MTA now so I can confirm that.  Has anyone else seen this issue 
> when running SA on Fedora linux?
> 
Not me (Postfix + spamd on Fedora 18 that's fully up to date on its patches as of last Friday. I have a total of 5 non-standard cf files in /etc/mail/spamassassin. All are being read and the rules and modules defined in them are in use. Modules include DecodeShortURLs, MimeMagic, and a locally written one. All the files in /etc/mail/spamassassin are owned by root.root and have at least "-rw-r--r--" permissions.

Are you using SElinux? I have it disabled.


Martin


> -----Original Message-----DecodeShortURLs
> From: Martin Gregorie [mailto:martin@gregorie.org]
> Sent: Monday, September 09, 2013 7:35 AM
> To: users@spamassassin.apache.org
> Subject: Re: Rules not working
> 
> The one relevant thing you haven't shown us is:
> 
> 1) which user you're running the debug test under.
> 
> 2) which user spamd is running under on your production system when
>    exim is using it. 
> 
> As jdow has said, the best way to see (2) is by running
> 
>   ps -ef | grep spamd
> 
> from any user. If the two users aren't the same, that's your problem because the user running spamd in (2) can't access your extra rules files.
> 
> You should also try running your debug tests after starting spamd in the same way that its started for exim and repeat your test using spamc in place of "spamassassin --debug": the list of rules hit on your test message will show whether this found your private rules or not.
> 
> FWIW, I always test rules in a spamc/spamd setup on a development host rather than by using spamassassin directly. I've organised things so that the testing copy of spamd is started under the same user as it runs under on the live system (I use postfix, not exim), so any access problems will be the same on both systems.
> 
> 
> Martin
> 
> 
> 




Re: Rules not working

Posted by Martin Gregorie <ma...@gregorie.org>.
On Mon, 2013-09-09 at 14:50 +0000, Raymond Jette wrote:
> I just create a new .cf file on my second MTA and I'm having the same
> problem.  I don't think this is with my systems.  I'm beginning to
> think it's with the packages in the Fedora repository.  I'm setting up
> a test MTA now so I can confirm that.  Has anyone else seen this issue
> when running SA on Fedora linux?
> 
Not me (Postfix + spamd on Fedora 18 that's fully up to date on its
patches as of last Friday. I have a total of 5 non-standard cf files
in /etc/mail/spamassassin. All are being read and the rules and modules
defined in them are in use. Modules include DecodeShortURLs, MimeMagic,
and a locally written one. All the files in /etc/mail/spamassassin are
owned by root.root and have at least "-rw-r--r--" permissions.

Are you using SElinux? I have it disabled.


Martin


> -----Original Message-----DecodeShortURLs
> From: Martin Gregorie [mailto:martin@gregorie.org] 
> Sent: Monday, September 09, 2013 7:35 AM
> To: users@spamassassin.apache.org
> Subject: Re: Rules not working
> 
> The one relevant thing you haven't shown us is:
> 
> 1) which user you're running the debug test under.
> 
> 2) which user spamd is running under on your production system when
>    exim is using it. 
> 
> As jdow has said, the best way to see (2) is by running 
> 
>   ps -ef | grep spamd
> 
> from any user. If the two users aren't the same, that's your problem because the user running spamd in (2) can't access your extra rules files.
> 
> You should also try running your debug tests after starting spamd in the same way that its started for exim and repeat your test using spamc in place of "spamassassin --debug": the list of rules hit on your test message will show whether this found your private rules or not.
> 
> FWIW, I always test rules in a spamc/spamd setup on a development host rather than by using spamassassin directly. I've organised things so that the testing copy of spamd is started under the same user as it runs under on the live system (I use postfix, not exim), so any access problems will be the same on both systems.
> 
> 
> Martin
> 
> 
> 




RE: Rules not working

Posted by Raymond Jette <rj...@mestek.com>.
I just create a new .cf file on my second MTA and I'm having the same problem.  I don't think this is with my systems.  I'm beginning to think it's with the packages in the Fedora repository.  I'm setting up a test MTA now so I can confirm that.  Has anyone else seen this issue when running SA on Fedora linux?

-----Original Message-----
From: Martin Gregorie [mailto:martin@gregorie.org] 
Sent: Monday, September 09, 2013 7:35 AM
To: users@spamassassin.apache.org
Subject: Re: Rules not working

The one relevant thing you haven't shown us is:

1) which user you're running the debug test under.

2) which user spamd is running under on your production system when
   exim is using it. 

As jdow has said, the best way to see (2) is by running 

  ps -ef | grep spamd

from any user. If the two users aren't the same, that's your problem because the user running spamd in (2) can't access your extra rules files.

You should also try running your debug tests after starting spamd in the same way that its started for exim and repeat your test using spamc in place of "spamassassin --debug": the list of rules hit on your test message will show whether this found your private rules or not.

FWIW, I always test rules in a spamc/spamd setup on a development host rather than by using spamassassin directly. I've organised things so that the testing copy of spamd is started under the same user as it runs under on the live system (I use postfix, not exim), so any access problems will be the same on both systems.


Martin




RE: Rules not working

Posted by Benny Pedersen <me...@junc.eu>.
Raymond Jette skrev den 2013-09-09 16:24:
> I'm not sure why but my spamd is running as
> root (I will have to change this).

if you can drop priveledges from non priveleges user then you definly 
knows something i dont know :)

spamd runs as root, but execute as -u in commandline on spamc, you can 
find the exact same problem in apache


Re: Rules not working

Posted by Martin Gregorie <ma...@gregorie.org>.
On Mon, 2013-09-09 at 14:24 +0000, Raymond Jette wrote:
> Thanks for the reply.  I'm not sure why but my spamd is running as
> root (I will have to change this).
>
I run Fedora 18, so it also uses systemd rather than the old SysV init.
By default my systemd configuration runs spamd as root. I don't know
why, as Postfix gets run in its own 'postfix' user.

Martin




RE: Rules not working

Posted by Raymond Jette <rj...@mestek.com>.
Thanks for the reply.  I'm not sure why but my spamd is running as root (I will have to change this).  I've done my tests, from spamd, from both the root and exim users.  These test work both times and I see the rules being loaded.  

-----Original Message-----
From: Martin Gregorie [mailto:martin@gregorie.org] 
Sent: Monday, September 09, 2013 7:35 AM
To: users@spamassassin.apache.org
Subject: Re: Rules not working

The one relevant thing you haven't shown us is:

1) which user you're running the debug test under.

2) which user spamd is running under on your production system when
   exim is using it. 

As jdow has said, the best way to see (2) is by running 

  ps -ef | grep spamd

from any user. If the two users aren't the same, that's your problem because the user running spamd in (2) can't access your extra rules files.

You should also try running your debug tests after starting spamd in the same way that its started for exim and repeat your test using spamc in place of "spamassassin --debug": the list of rules hit on your test message will show whether this found your private rules or not.

FWIW, I always test rules in a spamc/spamd setup on a development host rather than by using spamassassin directly. I've organised things so that the testing copy of spamd is started under the same user as it runs under on the live system (I use postfix, not exim), so any access problems will be the same on both systems.


Martin




Re: Rules not working

Posted by Martin Gregorie <ma...@gregorie.org>.
The one relevant thing you haven't shown us is:

1) which user you're running the debug test under.

2) which user spamd is running under on your production system when
   exim is using it. 

As jdow has said, the best way to see (2) is by running 

  ps -ef | grep spamd

from any user. If the two users aren't the same, that's your problem
because the user running spamd in (2) can't access your extra rules
files.

You should also try running your debug tests after starting spamd in the
same way that its started for exim and repeat your test using spamc in
place of "spamassassin --debug": the list of rules hit on your test
message will show whether this found your private rules or not.

FWIW, I always test rules in a spamc/spamd setup on a development host
rather than by using spamassassin directly. I've organised things so
that the testing copy of spamd is started under the same user as it runs
under on the live system (I use postfix, not exim), so any access
problems will be the same on both systems.


Martin




RE: Rules not working

Posted by Raymond Jette <rj...@mestek.com>.
When I run exim in debug rules my custom cf files are never added and the rules never hit.  Thanks.

-----Original Message-----
From: John Horne [mailto:john.horne@plymouth.ac.uk] 
Sent: Monday, September 09, 2013 5:56 AM
To: SpamAssassin
Subject: Re: Rules not working

On Mon, 2013-09-09 at 02:19 +0000, Raymond Jette wrote:
> Thanks for the information.  When running it this way everything 
> works.  I'm not sure why it is not working with normal mail flow.
>
I don't think you mentioned which O/S you are using. However, you may (it depends on your O/S) find spamassassin startup options in the '/etc/sysconfig/spamassassin' file.

As you are using exim you could run exim itself in debug mode to maybe see what is happening. Try something like:

  exim  -d'+all' recipient_addr  </tmp/msg  >/tmp/exim-test  2>&1

where 'recipient_addr' is some suitable recipient address for your site.
This will produce a lot of output, hence it is redirected to the file '/tmp/exim-test'. The file '/tmp/msg' is an email message, complete with headers.

You should then be able to look in the '/tmp/exim-test' file and see the flow of the message through exim. In particular what happens to it when SA is called (if it is called). (I assume you are using 'spam' in some ACL to call spamassassin.)





John.

-- 
John Horne                   Tel: +44 (0)1752 587287
Plymouth University, UK      Fax: +44 (0)1752 587001

Re: Rules not working

Posted by John Horne <jo...@plymouth.ac.uk>.
On Mon, 2013-09-09 at 02:19 +0000, Raymond Jette wrote:
> Thanks for the information.  When running it this way everything
> works.  I'm not sure why it is not working with normal mail flow.
>
I don't think you mentioned which O/S you are using. However, you may
(it depends on your O/S) find spamassassin startup options in the
'/etc/sysconfig/spamassassin' file.

As you are using exim you could run exim itself in debug mode to maybe
see what is happening. Try something like:

  exim  -d'+all' recipient_addr  </tmp/msg  >/tmp/exim-test  2>&1

where 'recipient_addr' is some suitable recipient address for your site.
This will produce a lot of output, hence it is redirected to the file
'/tmp/exim-test'. The file '/tmp/msg' is an email message, complete with
headers.

You should then be able to look in the '/tmp/exim-test' file and see the
flow of the message through exim. In particular what happens to it when
SA is called (if it is called). (I assume you are using 'spam' in some
ACL to call spamassassin.)





John.

-- 
John Horne                   Tel: +44 (0)1752 587287
Plymouth University, UK      Fax: +44 (0)1752 587001

RE: Rules not working

Posted by Raymond Jette <rj...@mestek.com>.
Thanks for the information.  When running it this way everything works.  I'm not sure why it is not working with normal mail flow.
________________________________________
From: jdow [jdow@earthlink.net]
Sent: Sunday, September 08, 2013 10:10 PM
To: users@spamassassin.apache.org
Subject: Re: Rules not working

One would then expect the contents of a.cf to be read.

Note that it's historically customary to preceed the basic filename
with a two digit number and an underscore. The rules are read in
alphabetical order, which translates to numerical order for the
numbered rules. "local.cf" is read first of all, of course.

{^_^}

On 2013/09/08 18:34, Raymond Jette wrote:
> I stoped spamd
>
> # systemctl stop spamassassin.service
>
> Then I ran in debug mode
>
> # echo | spamd -D > /root/spamdDiag 2>&1
>
> The following line shows a custom test file I created being read in
>
> Sep  8 21:31:45.423 [10285] dbg: config: read file /etc/mail/spamassassin/a.cf
>
> Thanks.
> ________________________________________
> From: jdow [jdow@earthlink.net]
> Sent: Sunday, September 08, 2013 9:20 PM
> To: users@spamassassin.apache.org
> Subject: Re: Rules not working
>
> Have you generated said debug output by running spamd with the -D flag?
> That is the debug output that matters. Also run spamassassin -D as a
> bog standard user rather than root.
>
> To minimize interruptions to mail flow I'd test it this way:
>
> stop spamd
>
> manually start spamd with the -D flag as well as all the other usual flags
> and values.
>
> Run tests through it using regular mail and a manual "spamc".
>
> Stop the -D spamd.
>
> Restart the normal spamd.
>
> This should only take a minute or two.
>
> {^_^}
>
>
> On 2013/09/08 18:09, Raymond Jette wrote:
>> Yes.  The permissions are correct.  Yes, the debug output shows that the files and rules were found and matched against the test message.
>> ________________________________________
>> From: jdow [jdow@earthlink.net]
>> Sent: Sunday, September 08, 2013 9:01 PM
>> To: users@spamassassin.apache.org
>> Subject: Re: Rules not working
>>
>> Did you set permissions? (-rw-r--r--)
>>
>> Are there any signs in the debug output that the files were even found at all?
>> Whatever it is that actually calls spamd or uses spamassassin internally may
>> do something to direct it off into left field.
>>
>> {^_^}
>>
>> On 2013/09/08 17:23, Raymond Jette wrote:
>>> Yes.  I restarted everything.  When this did not work I rebooted the server.  This still did not help.
>>> ________________________________________
>>> From: jdow [jdow@earthlink.net]
>>> Sent: Sunday, September 08, 2013 8:21 PM
>>> To: users@spamassassin.apache.org
>>> Subject: Re: Rules not working
>>>
>>> On 2013/09/08 16:55, Raymond Jette wrote:
>>>> When I add add custom rules to /etc/mail/spamassassin/local.cf the rules work as expected.  If I create any *.cf file and put the rules in they do not work.  My test rule is:
>>>>
>>>> body     test_match_all     /.*/
>>>> score    test_match_all     -0.01
>>>>
>>>> Rules only work if they are in local.cf.  If I run the following command:
>>>>
>>>> echo | spamassassin --debug
>>>>
>>>> I can see my custom rules that are in files other than local.cf get called.  Why would they work this way but never get called when spamd is called from exim?
>>>>
>>>> Thanks for any help you can provide,
>>>> Ray
>>>
>>> Did you restart spamassassin or the tool that uses spamassassin itself?
>>>
>>> {^_^}
>>>
>>>
>>
>

Re: Rules not working

Posted by jdow <jd...@earthlink.net>.
One would then expect the contents of a.cf to be read.

Note that it's historically customary to preceed the basic filename
with a two digit number and an underscore. The rules are read in
alphabetical order, which translates to numerical order for the
numbered rules. "local.cf" is read first of all, of course.

{^_^}

On 2013/09/08 18:34, Raymond Jette wrote:
> I stoped spamd
>
> # systemctl stop spamassassin.service
>
> Then I ran in debug mode
>
> # echo | spamd -D > /root/spamdDiag 2>&1
>
> The following line shows a custom test file I created being read in
>
> Sep  8 21:31:45.423 [10285] dbg: config: read file /etc/mail/spamassassin/a.cf
>
> Thanks.
> ________________________________________
> From: jdow [jdow@earthlink.net]
> Sent: Sunday, September 08, 2013 9:20 PM
> To: users@spamassassin.apache.org
> Subject: Re: Rules not working
>
> Have you generated said debug output by running spamd with the -D flag?
> That is the debug output that matters. Also run spamassassin -D as a
> bog standard user rather than root.
>
> To minimize interruptions to mail flow I'd test it this way:
>
> stop spamd
>
> manually start spamd with the -D flag as well as all the other usual flags
> and values.
>
> Run tests through it using regular mail and a manual "spamc".
>
> Stop the -D spamd.
>
> Restart the normal spamd.
>
> This should only take a minute or two.
>
> {^_^}
>
>
> On 2013/09/08 18:09, Raymond Jette wrote:
>> Yes.  The permissions are correct.  Yes, the debug output shows that the files and rules were found and matched against the test message.
>> ________________________________________
>> From: jdow [jdow@earthlink.net]
>> Sent: Sunday, September 08, 2013 9:01 PM
>> To: users@spamassassin.apache.org
>> Subject: Re: Rules not working
>>
>> Did you set permissions? (-rw-r--r--)
>>
>> Are there any signs in the debug output that the files were even found at all?
>> Whatever it is that actually calls spamd or uses spamassassin internally may
>> do something to direct it off into left field.
>>
>> {^_^}
>>
>> On 2013/09/08 17:23, Raymond Jette wrote:
>>> Yes.  I restarted everything.  When this did not work I rebooted the server.  This still did not help.
>>> ________________________________________
>>> From: jdow [jdow@earthlink.net]
>>> Sent: Sunday, September 08, 2013 8:21 PM
>>> To: users@spamassassin.apache.org
>>> Subject: Re: Rules not working
>>>
>>> On 2013/09/08 16:55, Raymond Jette wrote:
>>>> When I add add custom rules to /etc/mail/spamassassin/local.cf the rules work as expected.  If I create any *.cf file and put the rules in they do not work.  My test rule is:
>>>>
>>>> body     test_match_all     /.*/
>>>> score    test_match_all     -0.01
>>>>
>>>> Rules only work if they are in local.cf.  If I run the following command:
>>>>
>>>> echo | spamassassin --debug
>>>>
>>>> I can see my custom rules that are in files other than local.cf get called.  Why would they work this way but never get called when spamd is called from exim?
>>>>
>>>> Thanks for any help you can provide,
>>>> Ray
>>>
>>> Did you restart spamassassin or the tool that uses spamassassin itself?
>>>
>>> {^_^}
>>>
>>>
>>
>

RE: Rules not working

Posted by Raymond Jette <rj...@mestek.com>.
I stoped spamd

# systemctl stop spamassassin.service

Then I ran in debug mode

# echo | spamd -D > /root/spamdDiag 2>&1

The following line shows a custom test file I created being read in

Sep  8 21:31:45.423 [10285] dbg: config: read file /etc/mail/spamassassin/a.cf

Thanks.
________________________________________
From: jdow [jdow@earthlink.net]
Sent: Sunday, September 08, 2013 9:20 PM
To: users@spamassassin.apache.org
Subject: Re: Rules not working

Have you generated said debug output by running spamd with the -D flag?
That is the debug output that matters. Also run spamassassin -D as a
bog standard user rather than root.

To minimize interruptions to mail flow I'd test it this way:

stop spamd

manually start spamd with the -D flag as well as all the other usual flags
and values.

Run tests through it using regular mail and a manual "spamc".

Stop the -D spamd.

Restart the normal spamd.

This should only take a minute or two.

{^_^}


On 2013/09/08 18:09, Raymond Jette wrote:
> Yes.  The permissions are correct.  Yes, the debug output shows that the files and rules were found and matched against the test message.
> ________________________________________
> From: jdow [jdow@earthlink.net]
> Sent: Sunday, September 08, 2013 9:01 PM
> To: users@spamassassin.apache.org
> Subject: Re: Rules not working
>
> Did you set permissions? (-rw-r--r--)
>
> Are there any signs in the debug output that the files were even found at all?
> Whatever it is that actually calls spamd or uses spamassassin internally may
> do something to direct it off into left field.
>
> {^_^}
>
> On 2013/09/08 17:23, Raymond Jette wrote:
>> Yes.  I restarted everything.  When this did not work I rebooted the server.  This still did not help.
>> ________________________________________
>> From: jdow [jdow@earthlink.net]
>> Sent: Sunday, September 08, 2013 8:21 PM
>> To: users@spamassassin.apache.org
>> Subject: Re: Rules not working
>>
>> On 2013/09/08 16:55, Raymond Jette wrote:
>>> When I add add custom rules to /etc/mail/spamassassin/local.cf the rules work as expected.  If I create any *.cf file and put the rules in they do not work.  My test rule is:
>>>
>>> body     test_match_all     /.*/
>>> score    test_match_all     -0.01
>>>
>>> Rules only work if they are in local.cf.  If I run the following command:
>>>
>>> echo | spamassassin --debug
>>>
>>> I can see my custom rules that are in files other than local.cf get called.  Why would they work this way but never get called when spamd is called from exim?
>>>
>>> Thanks for any help you can provide,
>>> Ray
>>
>> Did you restart spamassassin or the tool that uses spamassassin itself?
>>
>> {^_^}
>>
>>
>

Re: Rules not working

Posted by jdow <jd...@earthlink.net>.
Have you generated said debug output by running spamd with the -D flag?
That is the debug output that matters. Also run spamassassin -D as a
bog standard user rather than root.

To minimize interruptions to mail flow I'd test it this way:

stop spamd

manually start spamd with the -D flag as well as all the other usual flags
and values.

Run tests through it using regular mail and a manual "spamc".

Stop the -D spamd.

Restart the normal spamd.

This should only take a minute or two.

{^_^}


On 2013/09/08 18:09, Raymond Jette wrote:
> Yes.  The permissions are correct.  Yes, the debug output shows that the files and rules were found and matched against the test message.
> ________________________________________
> From: jdow [jdow@earthlink.net]
> Sent: Sunday, September 08, 2013 9:01 PM
> To: users@spamassassin.apache.org
> Subject: Re: Rules not working
>
> Did you set permissions? (-rw-r--r--)
>
> Are there any signs in the debug output that the files were even found at all?
> Whatever it is that actually calls spamd or uses spamassassin internally may
> do something to direct it off into left field.
>
> {^_^}
>
> On 2013/09/08 17:23, Raymond Jette wrote:
>> Yes.  I restarted everything.  When this did not work I rebooted the server.  This still did not help.
>> ________________________________________
>> From: jdow [jdow@earthlink.net]
>> Sent: Sunday, September 08, 2013 8:21 PM
>> To: users@spamassassin.apache.org
>> Subject: Re: Rules not working
>>
>> On 2013/09/08 16:55, Raymond Jette wrote:
>>> When I add add custom rules to /etc/mail/spamassassin/local.cf the rules work as expected.  If I create any *.cf file and put the rules in they do not work.  My test rule is:
>>>
>>> body     test_match_all     /.*/
>>> score    test_match_all     -0.01
>>>
>>> Rules only work if they are in local.cf.  If I run the following command:
>>>
>>> echo | spamassassin --debug
>>>
>>> I can see my custom rules that are in files other than local.cf get called.  Why would they work this way but never get called when spamd is called from exim?
>>>
>>> Thanks for any help you can provide,
>>> Ray
>>
>> Did you restart spamassassin or the tool that uses spamassassin itself?
>>
>> {^_^}
>>
>>
>

RE: Rules not working

Posted by Raymond Jette <rj...@mestek.com>.
Yes.  The permissions are correct.  Yes, the debug output shows that the files and rules were found and matched against the test message.
________________________________________
From: jdow [jdow@earthlink.net]
Sent: Sunday, September 08, 2013 9:01 PM
To: users@spamassassin.apache.org
Subject: Re: Rules not working

Did you set permissions? (-rw-r--r--)

Are there any signs in the debug output that the files were even found at all?
Whatever it is that actually calls spamd or uses spamassassin internally may
do something to direct it off into left field.

{^_^}

On 2013/09/08 17:23, Raymond Jette wrote:
> Yes.  I restarted everything.  When this did not work I rebooted the server.  This still did not help.
> ________________________________________
> From: jdow [jdow@earthlink.net]
> Sent: Sunday, September 08, 2013 8:21 PM
> To: users@spamassassin.apache.org
> Subject: Re: Rules not working
>
> On 2013/09/08 16:55, Raymond Jette wrote:
>> When I add add custom rules to /etc/mail/spamassassin/local.cf the rules work as expected.  If I create any *.cf file and put the rules in they do not work.  My test rule is:
>>
>> body     test_match_all     /.*/
>> score    test_match_all     -0.01
>>
>> Rules only work if they are in local.cf.  If I run the following command:
>>
>> echo | spamassassin --debug
>>
>> I can see my custom rules that are in files other than local.cf get called.  Why would they work this way but never get called when spamd is called from exim?
>>
>> Thanks for any help you can provide,
>> Ray
>
> Did you restart spamassassin or the tool that uses spamassassin itself?
>
> {^_^}
>
>

Re: Rules not working

Posted by jdow <jd...@earthlink.net>.
Did you set permissions? (-rw-r--r--)

Are there any signs in the debug output that the files were even found at all?
Whatever it is that actually calls spamd or uses spamassassin internally may
do something to direct it off into left field.

{^_^}

On 2013/09/08 17:23, Raymond Jette wrote:
> Yes.  I restarted everything.  When this did not work I rebooted the server.  This still did not help.
> ________________________________________
> From: jdow [jdow@earthlink.net]
> Sent: Sunday, September 08, 2013 8:21 PM
> To: users@spamassassin.apache.org
> Subject: Re: Rules not working
>
> On 2013/09/08 16:55, Raymond Jette wrote:
>> When I add add custom rules to /etc/mail/spamassassin/local.cf the rules work as expected.  If I create any *.cf file and put the rules in they do not work.  My test rule is:
>>
>> body     test_match_all     /.*/
>> score    test_match_all     -0.01
>>
>> Rules only work if they are in local.cf.  If I run the following command:
>>
>> echo | spamassassin --debug
>>
>> I can see my custom rules that are in files other than local.cf get called.  Why would they work this way but never get called when spamd is called from exim?
>>
>> Thanks for any help you can provide,
>> Ray
>
> Did you restart spamassassin or the tool that uses spamassassin itself?
>
> {^_^}
>
>

RE: Rules not working

Posted by Raymond Jette <rj...@mestek.com>.
Yes.  I restarted everything.  When this did not work I rebooted the server.  This still did not help.
________________________________________
From: jdow [jdow@earthlink.net]
Sent: Sunday, September 08, 2013 8:21 PM
To: users@spamassassin.apache.org
Subject: Re: Rules not working

On 2013/09/08 16:55, Raymond Jette wrote:
> When I add add custom rules to /etc/mail/spamassassin/local.cf the rules work as expected.  If I create any *.cf file and put the rules in they do not work.  My test rule is:
>
> body     test_match_all     /.*/
> score    test_match_all     -0.01
>
> Rules only work if they are in local.cf.  If I run the following command:
>
> echo | spamassassin --debug
>
> I can see my custom rules that are in files other than local.cf get called.  Why would they work this way but never get called when spamd is called from exim?
>
> Thanks for any help you can provide,
> Ray

Did you restart spamassassin or the tool that uses spamassassin itself?

{^_^}


Re: Rules not working

Posted by jdow <jd...@earthlink.net>.
On 2013/09/08 16:55, Raymond Jette wrote:
> When I add add custom rules to /etc/mail/spamassassin/local.cf the rules work as expected.  If I create any *.cf file and put the rules in they do not work.  My test rule is:
>
> body     test_match_all     /.*/
> score    test_match_all     -0.01
>
> Rules only work if they are in local.cf.  If I run the following command:
>
> echo | spamassassin --debug
>
> I can see my custom rules that are in files other than local.cf get called.  Why would they work this way but never get called when spamd is called from exim?
>
> Thanks for any help you can provide,
> Ray

Did you restart spamassassin or the tool that uses spamassassin itself?

{^_^}


RE: Rules not working

Posted by Benny Pedersen <me...@junc.eu>.
Raymond Jette skrev den 2013-09-09 03:07:
> I checked the permissions.  Everything is set correctly.  Thanks for 
> the reply.

only your reply did not work, your mua did not cut quotes down

check from same user that exim uses to call spamc ? or does exim have 
its own native spamc that talks to port on spamd ?

this is not a permission issues then



RE: Rules not working

Posted by Raymond Jette <rj...@mestek.com>.
I checked the permissions.  Everything is set correctly.  Thanks for the reply.
________________________________________
From: Dave Funk [dbfunk@engineering.uiowa.edu]
Sent: Sunday, September 08, 2013 8:55 PM
To: Raymond Jette
Cc: users@spamassassin.apache.org
Subject: Re: Rules not working

On Sun, 8 Sep 2013, Raymond Jette wrote:

> When I add add custom rules to /etc/mail/spamassassin/local.cf the rules work as expected.  If I create any *.cf file and put the rules in they do not work.  My test rule is:
>
> body     test_match_all     /.*/
> score    test_match_all     -0.01
>
> Rules only work if they are in local.cf.  If I run the following command:
>
> echo | spamassassin --debug
>
> I can see my custom rules that are in files other than local.cf get called.  Why would they work this way but never get called when spamd is called from exim?
>
> Thanks for any help you can provide,
> Ray

File system permissions issues? Are the new rules files readable by the
"exim" user?


--
Dave Funk                                  University of Iowa
<dbfunk (at) engineering.uiowa.edu>        College of Engineering
319/335-5751   FAX: 319/384-0549           1256 Seamans Center
Sys_admin/Postmaster/cell_admin            Iowa City, IA 52242-1527
#include <std_disclaimer.h>
Better is not better, 'standard' is better. B{

RE: Rules not working

Posted by Raymond Jette <rj...@mestek.com>.
I don’t really think it is permissions related.  Spamd runs as root (I know this needs to change).  The local.cf file is read in correct.  The custom cf files I create have the same owner and permissions as local.cf.

-----Original Message-----
From: Benny Pedersen [mailto:me@junc.eu] 
Sent: Monday, September 09, 2013 3:33 AM
To: users@spamassassin.apache.org
Subject: Re: Rules not working

Dave Funk skrev den 2013-09-09 02:55:

> File system permissions issues? Are the new rules files readable by 
> the "exim" user?

spamd ?

its like calling dovecot-lmtp with inet ports that does not listen ? eg unix socket

using here spampd with postfix, no problem at all with permissions on spamassassin rules all owned by root and chmod 644 with is default btw

Re: Rules not working

Posted by Benny Pedersen <me...@junc.eu>.
Dave Funk skrev den 2013-09-09 02:55:

> File system permissions issues? Are the new rules files readable by
> the "exim" user?

spamd ?

its like calling dovecot-lmtp with inet ports that does not listen ? eg 
unix socket

using here spampd with postfix, no problem at all with permissions on 
spamassassin rules all owned by root and chmod 644 with is default btw

Re: Rules not working

Posted by Dave Funk <db...@engineering.uiowa.edu>.
On Sun, 8 Sep 2013, Raymond Jette wrote:

> When I add add custom rules to /etc/mail/spamassassin/local.cf the rules work as expected.  If I create any *.cf file and put the rules in they do not work.  My test rule is:
>
> body     test_match_all     /.*/
> score    test_match_all     -0.01
>
> Rules only work if they are in local.cf.  If I run the following command:
>
> echo | spamassassin --debug
>
> I can see my custom rules that are in files other than local.cf get called.  Why would they work this way but never get called when spamd is called from exim?
>
> Thanks for any help you can provide,
> Ray

File system permissions issues? Are the new rules files readable by the 
"exim" user?


-- 
Dave Funk                                  University of Iowa
<dbfunk (at) engineering.uiowa.edu>        College of Engineering
319/335-5751   FAX: 319/384-0549           1256 Seamans Center
Sys_admin/Postmaster/cell_admin            Iowa City, IA 52242-1527
#include <std_disclaimer.h>
Better is not better, 'standard' is better. B{