No X-Spam- headers appearing

2013-09-26 Thread Philip Colmer
I've just installed SA 3.3.2 on an Ubuntu server to be used with Mailman,
using apt-get install spamassassin.

I've mostly followed the instructions in
http://www.jamesh.id.au/articles/mailman-spamassassin/ - I say mostly
because (a) it looks like James was using a different distro so the
configuration file is in a different place and (b) it looks like he was
using an older version because the configuration options have changed.

Anyhow, SA seems to be working nicely with Mailman, in that /var/log/syslog
is showing me things like:

Sep 26 12:57:43 ip-10-141-164-156 spamd[7659]: spamd: connection from
localhost [127.0.0.1] at port 58125
Sep 26 12:57:43 ip-10-141-164-156 spamd[7659]: spamd: using default config
for linaro-mm-sig: /var/lib/spamassassin/linaro-mm-sig.prefs/user_prefs
Sep 26 12:57:43 ip-10-141-164-156 spamd[7659]: spamd: checking message 
3535d648a078fd18d0cc6f13ea347...@rkmryshu.net for linaro-mm-sig:999
Sep 26 12:57:48 ip-10-141-164-156 spamd[7659]: spamd: identified spam
(10.7/5.0) for linaro-mm-sig:999 in 4.5 seconds, 11234 bytes.
Sep 26 12:57:48 ip-10-141-164-156 spamd[7659]: spamd: result: Y 10 -
DOS_OE_TO_MX,MIME_BASE64_BLANKS,NO_DNS_FOR_FROM,RCVD_IN_BRBL_LASTEXT,RCVD_IN_PBL,RCVD_IN_XBL,RDNS_NONE,WEIRD_QUOTING
scantime=4.5,size=11234,user=linaro-mm-sig,uid=999,required_score=5.0,rhost=localhost,raddr=127.0.0.1,rport=58125,mid=
3535d648a078fd18d0cc6f13ea347...@rkmryshu.net,autolearn=no

However, the emails are NOT getting spam headers inserted, whether they are
ham or spam.

According to
http://spamassassin.apache.org/full/3.3.x/doc/Mail_SpamAssassin_Conf.html:

Note that X-Spam-Checker-Version is not removable because the version
information is needed by mail administrators and developers to debug
problems. Without at least one header, it might not even be possible to
determine that SpamAssassin is running.

so I would, at the very least, expect X-Spam-Checker-Version to appear in
all emails. Furthermore, the documentation says:

Here are some examples (these are the defaults, note that Checker-Version
can not be changed or removed):

  add_header spam Flag _YESNOCAPS_
  add_header all Status _YESNO_, score=_SCORE_ required=_REQD_
tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_
  add_header all Level _STARS(*)_
  add_header all Checker-Version SpamAssassin _VERSION_ (_SUBVERSION_) on
_HOSTNAME_

Even though the documentation says these are the defaults, I've added them
anyway to /etc/spamassassin/local.cf and restarted spamd, but the headers
still aren't being inserted.

One blog I found (
http://blog.dmitryleskov.com/small-hacks/forcing-spamassassin-to-add-the-x-spam-status-header-to-ham-for-debugging/)
suggests that these headers are actually added by amavisd ... which I don't
have installed. However, the blog posting does say:

In other words, in configurations where SpamAssasin is controlled by
amavisd-new, the X-Spam- headers are actually added by the latter, and it
is amavisd-new that decides whether to add them.

so, since SA is *not* being controlled by amavisd-new on my system, I don't
think this applies anyway.

The same blog posting suggests that the X-Spam headers will only appear on
messages that have some score and not pure ham messages, but I've checked a
message that got a score of 10.7 and there are no headers in it.

What am I misunderstanding or what have I overlooked?

Thanks.

Philip


Re: No X-Spam- headers appearing

2013-09-26 Thread Karsten Bräckelmann
On Thu, 2013-09-26 at 14:11 +0100, Philip Colmer wrote:
 I've just installed SA 3.3.2 on an Ubuntu server to be used with
 Mailman, using apt-get install spamassassin.
 
 I've mostly followed the instructions in
 http://www.jamesh.id.au/articles/mailman-spamassassin/  [...]

 However, the emails are NOT getting spam headers inserted, whether
 they are ham or spam. 

That's due to the Mailman filter in above reference.

The Mailman filter uses the SYMBOLS spamd method, rather than PROCESS,
which makes spamd return the status, score and a list of rules hit only.
Unlike with PROCESS, the message itself is not returned, thus no X-Spam
headers either.

A closer look at the python code suggests, the filter even hardly cares
about the rules hit -- it just cares about the score to decide whether
to pass, moderate or discard the message. That decision is passed back
to the Mailman filter chain.


 What am I misunderstanding or what have I overlooked?

Generally, the client (a mailman filter in your case) passes the message
to spamd, which after processing returns the modified message. As you
pointed out correctly, this modification by default adds some X-Spam
headers, at the very least an X-Spam-Version header.

The docs you cited apply to SpamAssassin. The method the Mailman filter
uses is spamd specific, though, a daemon implementation using SA at its
core.


There's also a general misunderstanding here. While the client passes
the message (a copy of the message, rather), it is up to the client what
it does with the returned data -- including outright ignoring the result
with the X-Spam headers added, and proceeding with (a copy of) the
original message.

In order to have the added X-Spam headers show up later, the client has
to discard the original copy, and pass along the modified version as
received from the daemon.


If you want the X-Spam headers, you will need a different Mailman
filter / documentation to follow.


-- 
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;il;i++){ i%8? c=1:
(c=*++x); c128  (s+=h); if (!(h=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}



Re: No X-Spam- headers appearing

2013-09-26 Thread Philip Colmer
Thanks, Karsten, for your explanation. That makes sense and I'll have to
see whether the lack of headers is going to cause problems going forwards
or if looking in syslog will suffice.

Regards

Philip



On 26 September 2013 16:33, Karsten Bräckelmann guent...@rudersport.dewrote:

 On Thu, 2013-09-26 at 14:11 +0100, Philip Colmer wrote:
  I've just installed SA 3.3.2 on an Ubuntu server to be used with
  Mailman, using apt-get install spamassassin.
 
  I've mostly followed the instructions in
  http://www.jamesh.id.au/articles/mailman-spamassassin/  [...]

  However, the emails are NOT getting spam headers inserted, whether
  they are ham or spam.

 That's due to the Mailman filter in above reference.

 The Mailman filter uses the SYMBOLS spamd method, rather than PROCESS,
 which makes spamd return the status, score and a list of rules hit only.
 Unlike with PROCESS, the message itself is not returned, thus no X-Spam
 headers either.

 A closer look at the python code suggests, the filter even hardly cares
 about the rules hit -- it just cares about the score to decide whether
 to pass, moderate or discard the message. That decision is passed back
 to the Mailman filter chain.


  What am I misunderstanding or what have I overlooked?

 Generally, the client (a mailman filter in your case) passes the message
 to spamd, which after processing returns the modified message. As you
 pointed out correctly, this modification by default adds some X-Spam
 headers, at the very least an X-Spam-Version header.

 The docs you cited apply to SpamAssassin. The method the Mailman filter
 uses is spamd specific, though, a daemon implementation using SA at its
 core.


 There's also a general misunderstanding here. While the client passes
 the message (a copy of the message, rather), it is up to the client what
 it does with the returned data -- including outright ignoring the result
 with the X-Spam headers added, and proceeding with (a copy of) the
 original message.

 In order to have the added X-Spam headers show up later, the client has
 to discard the original copy, and pass along the modified version as
 received from the daemon.


 If you want the X-Spam headers, you will need a different Mailman
 filter / documentation to follow.


 --
 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;il;i++){ i%8?
 c=1:
 (c=*++x); c128  (s+=h); if (!(h=1)||!t[s+h]){ putchar(t[s]);h=m;s=0;
 }}}