1

Whenever I restarted my amavis process I encountered the message:

Starting amavisd: head: cannot open `/etc/mailname' for reading: No such file or directory amavisd-new.

I decided to add an /etc/mailname file with "mail.mydomain.com", and - alas - I stopped receiving these warnings.

However, I encountered a nasty side-effect in my Postfix+amavis+dovecot setup: received emails no longer have the X-spam headers.

Here is an email header when the file /etc/mailname does not exist:

Received: from localhost (localhost [127.0.0.1]) by webservices.mydomain.com (Postfix) with ESMTP id 599C912EA177 for ; Thu, 4 Jun 2015 18:10:07 +0100 (WEST) X-virus-scanned: Debian amavisd-new at X-spam-flag: NO X-spam-score: -1.999 X-spam-level: X-spam-status: No, score=-1.999 required=3.49 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=ham

Here is a similar email right after adding the mailname file (in this example, mailname has been populated with wtf.com)

Received: from localhost (localhost [127.0.0.1]) by webservices.mydomain.com (Postfix) with ESMTP id 7195812EA177 for ; Thu, 4 Jun 2015 18:12:28 +0100 (WEST) X-virus-scanned: Debian amavisd-new at wtf.com

Everything in bold has disappeared. Can you help me understand the relationship between the two events?

mmalmeida
  • 155
  • 1
  • 9
  • I might have found a reason. As per comment in http://serverfault.com/questions/504426/amavis-missing-x-spam-status-header and http://www.ijs.si/software/amavisd/, 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);. I had mail.mydomain.com and not mydomain.com ! – mmalmeida Jun 04 '15 at 17:30
  • 1
    If your question is solved, please close or answer it. – sebix Jun 05 '15 at 13:41

1 Answers1

2

As per comment in this serverfault post and here:

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

I had mail.mydomain.com and not mydomain.com. Upon changing it to mydomain.com I get the Spam-X headers as expected.

mmalmeida
  • 155
  • 1
  • 9