Solution 1:

Have you checked this parameter: @local_domains_acl

It is defined on /etc/amavis/conf.d/05-domain_id. According to the Amavisd-new documentation on http://www.ijs.si/software/amavisd/ :

No spam-related headers inserted? Here are some reasons:

  • @local_domains_acl is not correctly set. These headers are only inserted for recipients matching @local_domains_acl lookup (or %local_domains or $local_domains_re or field 'local' in SQL lookups);
  • (...)

Check the output of this command: head -n 1 /etc/mailname

If you will not get exactly your domain name than Amavisd will not apply any change to the headers of your emails. If you want to force the adding of the X-Spam-* headers than you can add something like this @local_domains_acl = ( "." ); on /etc/amavis/conf.d/50-user

Solution 2:

(This is really a comment to the previous answer, but the reputation system won't let me)

Setting @local_domains_acl = ( "." ) worked for me, but it seemed like a rather blunt instrument (i.e., spam processing all messages, in or out). Trying a number of alternatives, I eventually found that including localhost would also help (I'm testing with a delivery service on the same box). Thus, in /etc/amavis/conf.d/50-user I have something like:

@local_domains_acl = ( ".mydomain.example.org", "localhost" );

and I'm seeing messages delivered with spam headers added.

(My test setup here is Ubuntu 14.04 server, postfix, amaviz, spamassassin, all installed from standard Ubuntu repositories.)

Solution 3:

The output of command head -n 1 /etc/mailname must be your domain, like example.com.

If the output is something like mail.example.com, that's the bug.

So, you can fix this by changing the file /etc/amavis/conf.d/05-domain_id

Solution #1

Inside /etc/amavis/conf.d/05-domain_id:

Change:

    chomp($mydomain = `head -n 1 /etc/mailname`);

To:

    chomp($mydomain = `hostname -d`);

PS: The output of hostname -d must be your domain, like example.com.

Simplest solution than ever:

Inside /etc/amavis/conf.d/05-domain_id:

Change:

    chomp($mydomain = `head -n 1 /etc/mailname`);

To:

    $mydomain = "example.com";