Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I set up a mail server with Dovecot, Postfix and AMaViS on Debian Squeeze following the tutorial on workaround.org (ISPmail tutorial for Debian Squeeze). It uses virtual domains and stores the domains, e-mail addresses and accounts in a MySQL database.

Everything works fine – except I am missing some e-mail headers.

Received headers:

  • X-Quarantine-ID
  • X-Virus-Scanned

(With “real” spam and using the GTUBE via sendmail email@example.com < /usr/share/doc/spamassassin/examples/sample-spam.txt)

Missing headers:

  • X-Spam-Flag
  • X-Spam-Score
  • X-Spam-Level
  • X-Spam-Status

But spam e-mails get their subject changed. So I set up everything correct, didn’t I?

How do I get those missing headers in my mails?


Here my AMaViS configuration file (/etc/amavis/conf.d/50-user)

use strict;

#
# Place your configuration directives here.  They will override those in
# earlier files.
#
# See /usr/share/doc/amavisd-new/ for documentation and examples of
# the directives you can use in this file
#

# see <http://workaround.org/ispmail/squeeze/content-scanning-amavis>

$sa_spam_subject_tag = '*** SPAM *** ';
$final_spam_destiny = D_PASS;

$sa_tag_level_deflt = -9999; # add spam info headers if at, or above that level
$sa_tag2_level_deflt = 6.31; # add 'spam detected' headers at that level


@lookup_sql_dsn = ([
    'DBI:mysql:database=mailserver;host=127.0.0.1;port=3306',
    'mailuser',
    'password'
]);

$sql_select_policy = 'SELECT name FROM virtual_domains WHERE CONCAT("@",name) IN (%k)';

#------------ Do not modify anything below this line -------------
1;  # ensure a defined return

If you need more configuration files, log outputs or anything else, please leave a comment below and I will update my post with the information you need :-)

share|improve this question
add comment

1 Answer

Have you checked this parameter: @local_domains_acl

It is defined on /etc/amavis/conf.d/05-domain_id. According to the Amavisd-new documentaion 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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.