1

Topic: Spamassassin service is on STOPPED status

==== Provide required information ====
- iRedMail version and backend (LDAP/MySQL/PGSQL): iRedAdmin-Pro-LDAP-1.7.2
- Linux/BSD distribution name and version: CentOS 5.8
- Any related log? Log is helpful for troubleshooting.
====

Hi Zhang,


# service spamassassin status
spamd is stopped

Spamassassin service status shows stopped, is it a normal behavior ? or I have to start it? as upon server restart it is not starting so I thought it would be its normal behavior.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Spamassassin service is on STOPPED status

Works as designed.
SpamAssassin is invoked directly by Amavisd, not as a background daemon service.

3

Re: Spamassassin service is on STOPPED status

IS there any way to verify SpammAssassin is working appropriately or not?

4

Re: Spamassassin service is on STOPPED status

To make sure it's working as expected, please try this:

*) Decrease Amavisd setting sa_tag_level_deflt, so that amavisd will insert mail headers in almost all mails which 'X-Spam-Score' larger than it. For example:

$sa_tag_level_deflt  = -100;  # add spam info headers if at, or above that level

*) Restart amavisd service, send an testing email. You will find the headers like below:

X-Virus-Scanned: amavisd-new at r6.iredmail.org
X-Spam-Flag: NO
X-Spam-Score: -1.795
X-Spam-Level: 
X-Spam-Status: No, score=-1.795 tagged_above=-100 required=6.2
    tests=[ALL_TRUSTED=-10, DATE_IN_FUTURE_96_XX=3.899,
    NO_DNS_FOR_FROM=1.407, TVD_SPACE_RATIO=2.899] autolearn=no

You see "score=xxx"? That's SpamAssassin score.

5

Re: Spamassassin service is on STOPPED status

Hi Zhang,

I think SpamAssassin is not working as you directed. I changed the score settings to -100, restarted amavisd and tried sending email but source of the email shows:

X-Virus-Scanned: amavisd-new at mail.mydomain.com
Received: from mail.mydomain.com ([127.0.0.1])
    by localhost (mail.mydomain.com [127.0.0.1]) (amavisd-new, port 10024)
    with ESMTP id jq8C7SkndxbKw1 for <ketan@otherdomain.com>;
    Wed, 23 May 2012 08:16:14 +0100 (BST)
Received: from [x.xx.xxx.xx] (unknown [x.xx.xxx.xx])
    by mail.mydomain.com (Postfix) with ESMTPSA id E498AARDS42601DE
    for <ketan@bnsgroup.co.uk>; Wed, 23 May 2012 08:16:14 +0100 (BST)
Message-ID: <4FBC8ECB.6000100@mydomain.com>

its not showing :
X-Spam-Flag: NO
X-Spam-Score: -1.795
X-Spam-Level:

entries like you stated, is there any other settings which needs to consider?

6

Re: Spamassassin service is on STOPPED status

How did you send this testing email? Webmail or Outlook/Thunderbird? If it's sent with webmail, try Outlook/Thunderbird for one more testing.

7

Re: Spamassassin service is on STOPPED status

Zhang,

I tried sending test E-mails both way from webmail as well as from Thunderbird/outlook.

8

Re: Spamassassin service is on STOPPED status

Did you restart Amavisd service after changed config file?

Show me output of below command:

# grep 'sa_tag_level_deflt' /etc/amavisd.conf

9

Re: Spamassassin service is on STOPPED status

Zhang,

Yes I did restart amavisd and here is the output for your reference:

[root@mail log]# grep 'sa_tag_level_deflt' /etc/amavisd.conf
$sa_tag_level_deflt  = -100;  # add spam info headers if at, or above that level

10

Re: Spamassassin service is on STOPPED status

Please show me output of below command:

# grep 'bypass_spam_check' /etc/amavisd.conf

11 (edited by ketan.aagja 2012-05-23 21:28:25)

Re: Spamassassin service is on STOPPED status

here is the default output.

grep 'bypass_spam_check' /etc/amavisd.conf
# @bypass_spam_checks_maps  = (1);  # controls running of anti-spam code
# @bypass_virus_checks_maps, @bypass_spam_checks_maps,
#    bypass_spam_checks_maps   => [1],  # don't spam-check this mail
#    bypass_spam_checks_maps   => [1],  # don't spam-check this mail
#bypass_spam_checks_maps => [1],

its commented by default, do i need to un-comment anything?

12

Re: Spamassassin service is on STOPPED status

I have no idea at all, it should work as expected but it didn't.
Try this:

# /etc/init.d/amavisd stop
# amavisd debug-sa

Don't close this terminal. Then send testing email again, and check terminal output, try to find SpamAssassin related log.

13

Re: Spamassassin service is on STOPPED status

Hi Zhang,

Here is the output for your reference.

[root@mail log]# amavisd debug-sa
May 23 15:45:16.877 mail.mydomain.com /usr/sbin/amavisd[11088]: starting.  /usr/sbin/amavisd at mail.mydomain.com amavisd-new-2                    .6.4 (20090625), Unicode aware, LANG="en_US.UTF-8"
May 23 15:45:16.877 mail.mydomain.com /usr/sbin/amavisd[11088]: Perl version               5.008008
May 23 15:45:17.103 mail.mydomain.com /usr/sbin/amavisd[11088]: Net::Server: Group Not Defined.  Defaulting to EGID '159 159'
May 23 15:45:17.103 mail.mydomain.com /usr/sbin/amavisd[11088]: Net::Server: User Not Defined.  Defaulting to EUID '103'
May 23 15:45:17.112 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Amavis::Conf        2.207
May 23 15:45:17.112 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Archive::Zip        1.26
May 23 15:45:17.112 mail.mydomain.com /usr/sbin/amavisd[11088]: Module BerkeleyDB          0.36
May 23 15:45:17.112 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Compress::Zlib      2.03
May 23 15:45:17.112 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Convert::TNEF       0.17
May 23 15:45:17.112 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Convert::UUlib      1.11
May 23 15:45:17.113 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Crypt::OpenSSL::RSA 0.25
May 23 15:45:17.113 mail.mydomain.com /usr/sbin/amavisd[11088]: Module DBD::mysql          4.008
May 23 15:45:17.113 mail.mydomain.com /usr/sbin/amavisd[11088]: Module DBI                 1.52
May 23 15:45:17.113 mail.mydomain.com /usr/sbin/amavisd[11088]: Module DB_File             1.814
May 23 15:45:17.113 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Digest::MD5         2.36
May 23 15:45:17.113 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Digest::SHA         5.47
May 23 15:45:17.113 mail.mydomain.com /usr/sbin/amavisd[11088]: Module IO::Socket::INET6   2.51
May 23 15:45:17.114 mail.mydomain.com /usr/sbin/amavisd[11088]: Module MIME::Entity        5.420
May 23 15:45:17.114 mail.mydomain.com /usr/sbin/amavisd[11088]: Module MIME::Parser        5.420
May 23 15:45:17.114 mail.mydomain.com /usr/sbin/amavisd[11088]: Module MIME::Tools         5.420
May 23 15:45:17.114 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Mail::DKIM::Signer  0.36
May 23 15:45:17.114 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Mail::DKIM::Verifier 0.36
May 23 15:45:17.114 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Mail::Header        2.04
May 23 15:45:17.114 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Mail::Internet      2.04
May 23 15:45:17.115 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Mail::SPF           v2.006
May 23 15:45:17.115 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Mail::SpamAssassin  3.003001
May 23 15:45:17.115 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Net::DNS            0.59
May 23 15:45:17.115 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Net::LDAP           0.33
May 23 15:45:17.116 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Net::Server         0.97
May 23 15:45:17.116 mail.mydomain.com /usr/sbin/amavisd[11088]: Module NetAddr::IP         4.027
May 23 15:45:17.116 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Socket6             0.19
May 23 15:45:17.116 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Time::HiRes         1.9717
May 23 15:45:17.116 mail.mydomain.com /usr/sbin/amavisd[11088]: Module URI                 1.35
May 23 15:45:17.116 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Unix::Syslog        1.0
May 23 15:45:17.117 mail.mydomain.com /usr/sbin/amavisd[11088]: Amavis::DB code      loaded
May 23 15:45:17.117 mail.mydomain.com /usr/sbin/amavisd[11088]: Amavis::Cache code   loaded
May 23 15:45:17.117 mail.mydomain.com /usr/sbin/amavisd[11088]: SQL base code        loaded
May 23 15:45:17.117 mail.mydomain.com /usr/sbin/amavisd[11088]: SQL::Log code        loaded
May 23 15:45:17.117 mail.mydomain.com /usr/sbin/amavisd[11088]: SQL::Quarantine      NOT loaded
May 23 15:45:17.117 mail.mydomain.com /usr/sbin/amavisd[11088]: Lookup::SQL code     NOT loaded
May 23 15:45:17.117 mail.mydomain.com /usr/sbin/amavisd[11088]: Lookup::LDAP code    loaded
May 23 15:45:17.117 mail.mydomain.com /usr/sbin/amavisd[11088]: AM.PDP-in proto code loaded
May 23 15:45:17.117 mail.mydomain.com /usr/sbin/amavisd[11088]: SMTP-in proto code   loaded
May 23 15:45:17.117 mail.mydomain.com /usr/sbin/amavisd[11088]: Courier proto code   NOT loaded
May 23 15:45:17.117 mail.mydomain.com /usr/sbin/amavisd[11088]: SMTP-out proto code  loaded
May 23 15:45:17.117 mail.mydomain.com /usr/sbin/amavisd[11088]: Pipe-out proto code  NOT loaded
May 23 15:45:17.117 mail.mydomain.com /usr/sbin/amavisd[11088]: BSMTP-out proto code NOT loaded
May 23 15:45:17.118 mail.mydomain.com /usr/sbin/amavisd[11088]: Local-out proto code loaded
May 23 15:45:17.118 mail.mydomain.com /usr/sbin/amavisd[11088]: OS_Fingerprint code  NOT loaded
May 23 15:45:17.118 mail.mydomain.com /usr/sbin/amavisd[11088]: ANTI-VIRUS code      loaded
May 23 15:45:17.118 mail.mydomain.com /usr/sbin/amavisd[11088]: ANTI-SPAM code       loaded
May 23 15:45:17.118 mail.mydomain.com /usr/sbin/amavisd[11088]: ANTI-SPAM-EXT code   NOT loaded
May 23 15:45:17.118 mail.mydomain.com /usr/sbin/amavisd[11088]: ANTI-SPAM-C code     NOT loaded
May 23 15:45:17.118 mail.mydomain.com /usr/sbin/amavisd[11088]: ANTI-SPAM-SA code    loaded
May 23 15:45:17.118 mail.mydomain.com /usr/sbin/amavisd[11088]: Unpackers code       loaded
May 23 15:45:17.118 mail.mydomain.com /usr/sbin/amavisd[11088]: DKIM code            loaded
May 23 15:45:17.118 mail.mydomain.com /usr/sbin/amavisd[11088]: Tools code           NOT loaded
May 23 15:45:17.118 mail.mydomain.com /usr/sbin/amavisd[11088]: Found $file            at /usr/bin/file
May 23 15:45:17.118 mail.mydomain.com /usr/sbin/amavisd[11088]: Found $altermime       at /usr/bin/altermime
May 23 15:45:17.119 mail.mydomain.com /usr/sbin/amavisd[11088]: Internal decoder for .mail
May 23 15:45:17.119 mail.mydomain.com /usr/sbin/amavisd[11088]: Internal decoder for .asc
May 23 15:45:17.119 mail.mydomain.com /usr/sbin/amavisd[11088]: Internal decoder for .uue
May 23 15:45:17.119 mail.mydomain.com /usr/sbin/amavisd[11088]: Internal decoder for .hqx
May 23 15:45:17.119 mail.mydomain.com /usr/sbin/amavisd[11088]: Internal decoder for .ync
May 23 15:45:17.119 mail.mydomain.com /usr/sbin/amavisd[11088]: Found decoder for    .F    at /usr/bin/unfreeze
May 23 15:45:17.119 mail.mydomain.com /usr/sbin/amavisd[11088]: Found decoder for    .Z    at /usr/bin/uncompress
May 23 15:45:17.119 mail.mydomain.com /usr/sbin/amavisd[11088]: Found decoder for    .gz   at /usr/bin/gzip -d
May 23 15:45:17.119 mail.mydomain.com /usr/sbin/amavisd[11088]: Found decoder for    .bz2  at /usr/bin/bzip2 -d
May 23 15:45:17.119 mail.mydomain.com /usr/sbin/amavisd[11088]: Found decoder for    .lzo  at /usr/bin/lzop -d
May 23 15:45:17.120 mail.mydomain.com /usr/sbin/amavisd[11088]: Found decoder for    .rpm  at /usr/bin/rpm2cpio
May 23 15:45:17.120 mail.mydomain.com /usr/sbin/amavisd[11088]: Found decoder for    .cpio at /usr/bin/pax
May 23 15:45:17.120 mail.mydomain.com /usr/sbin/amavisd[11088]: Found decoder for    .tar  at /usr/bin/pax
May 23 15:45:17.120 mail.mydomain.com /usr/sbin/amavisd[11088]: Found decoder for    .deb  at /usr/bin/ar
May 23 15:45:17.120 mail.mydomain.com /usr/sbin/amavisd[11088]: Internal decoder for .zip
May 23 15:45:17.120 mail.mydomain.com /usr/sbin/amavisd[11088]: No decoder for       .7z   tried: 7zr, 7za, 7z
May 23 15:45:17.120 mail.mydomain.com /usr/sbin/amavisd[11088]: Found decoder for    .rar  at /usr/bin/unrar
May 23 15:45:17.120 mail.mydomain.com /usr/sbin/amavisd[11088]: Found decoder for    .arj  at /usr/bin/arj
May 23 15:45:17.121 mail.mydomain.com /usr/sbin/amavisd[11088]: Found decoder for    .arc  at /usr/bin/nomarch
May 23 15:45:17.121 mail.mydomain.com /usr/sbin/amavisd[11088]: Found decoder for    .zoo  at /usr/bin/zoo
May 23 15:45:17.121 mail.mydomain.com /usr/sbin/amavisd[11088]: Found decoder for    .lha  at /usr/bin/lha
May 23 15:45:17.121 mail.mydomain.com /usr/sbin/amavisd[11088]: Found decoder for    .cab  at /usr/bin/cabextract
May 23 15:45:17.121 mail.mydomain.com /usr/sbin/amavisd[11088]: No decoder for       .tnef tried: tnef
May 23 15:45:17.121 mail.mydomain.com /usr/sbin/amavisd[11088]: Internal decoder for .tnef
May 23 15:45:17.121 mail.mydomain.com /usr/sbin/amavisd[11088]: Found decoder for    .exe  at /usr/bin/unrar; /usr/bin/lha; /usr/bin                    /arj
May 23 15:45:17.121 mail.mydomain.com /usr/sbin/amavisd[11088]: Using primary internal av scanner code for ClamAV-clamd
May 23 15:45:17.122 mail.mydomain.com /usr/sbin/amavisd[11088]: Found secondary av scanner ClamAV-clamscan at /usr/bin/clamscan
May 23 15:45:17.123 mail.mydomain.com /usr/sbin/amavisd[11088]: Creating db in /var/amavis/db/; BerkeleyDB 0.36, libdb 4.3
May 23 15:45:47.882 mail.mydomain.com /usr/sbin/amavisd[11095]: (11095-01) Passed CLEAN, MYNETS/MYUSERS LOCAL [xxx.xxx.xxx.xxx] [172.16.                    1.13] <backup@mydomain.com> -> <backup@mydomain.com>, Message-ID: <4FBCF827.7020208@mydomain.com>, mail_id: P4K+fvLs8Cf6,                     Hits: -10, size: 574, queued_as: D1FB042601E8, 247 ms
May 23 15:45:47.884 mail.mydomain.com /usr/sbin/amavisd[11096]: (11096-01) Passed CLEAN, MYNETS/MYUSERS LOCAL [xxx.xxx.xxx.xxx] [172.16.                    1.13] <backup@mydomain.com> -> <ketan@otherdomain.com>, Message-ID: <4FBCF827.7020208@mydomain.com>, mail_id: rsMXnuMryDlc, Hits                    : -10, size: 574, queued_as: D2E4F42601E9, 247 ms

14

Re: Spamassassin service is on STOPPED status

ketan.aagja wrote:

May 23 15:45:17.115 mail.mydomain.com /usr/sbin/amavisd[11088]: Module Mail::SpamAssassin  3.003001

Amavisd loads SpamAssassin (version 3.003001).

ketan.aagja wrote:

May 23 15:45:47.882 mail.mydomain.com /usr/sbin/amavisd[11095]: (11095-01) Passed CLEAN, MYNETS/MYUSERS LOCAL [xxx.xxx.xxx.xxx] [172.16.1.13] <backup@mydomain.com> -> <backup@mydomain.com>, Message-ID: <4FBCF827.7020208@mydomain.com>, mail_id: P4K+fvLs8Cf6, Hits: -10, size: 574, queued_as: D1FB042601E8, 247 ms
May 23 15:45:47.884 mail.mydomain.com /usr/sbin/amavisd[11096]: (11096-01) Passed CLEAN, MYNETS/MYUSERS LOCAL [xxx.xxx.xxx.xxx] [172.16.1.13] <backup@mydomain.com> -> <ketan@otherdomain.com>, Message-ID: <4FBCF827.7020208@mydomain.com>, mail_id: rsMXnuMryDlc, Hits: -10, size: 574, queued_as: D2E4F42601E9, 247 ms

It shows Hits: -10, this is score tagged by SpamAssassin.

Oh, i forgot to mention that you have to list your domain names in Amavisd setting: @local_domains_maps. For example:

@local_domains_maps = ( [".$mydomain","iredmail.org"] );

15

Re: Spamassassin service is on STOPPED status

Hi Zhang,

Thanks for your explanation.

Please note that I have my domain in @local_domains_maps = ( [".$mydomain","mydomain.com"] ); already.
As per your suggestion Hits: -10 is score tagged by SpamAssissin then I think it is working but after doing -100 in conf file what will be the reason that it is not adding in mail headers?  like if we check mail source it should show the entries right?

16

Re: Spamassassin service is on STOPPED status

ketan.aagja wrote:

Please note that I have my domain in @local_domains_maps = ( [".$mydomain","mydomain.com"] ); already.
As per your suggestion Hits: -10 is score tagged by SpamAssissin then I think it is working but after doing -100 in conf file what will be the reason that it is not adding in mail headers?  like if we check mail source it should show the entries right?

Still no idea at all, it should work as expected but it doesn't. sad