I've set up a mailserver with postfix, dovecot, amavis and spamassassin. Everything has been up and running for a year now until I noticed my spamfilter wasn't performing as it should; spam mails sent to a normal user were getting the right treatment and ended up in Spam-box, whereas the same mail sent to an alias of that user weren't flagged as spam. If you look at the logs, my spamfilter does recognise the mail as spam, but no headers are inserted in the mail or they are removed afterwards.
Anyone knows where I should start to look for clues? I've been breaking my head on this one for quite some time now. Thank you, Philip This shows up in my logs. I send 4 mails; the first is a normal mail to normal user, second mail is normal mail to alias, then spam to normal user and finally spam to alias: Dec 29 13:48:29 test-services postfix/pickup[9435]: 5A4C34A4AC: uid=0 from=<root> Dec 29 13:48:29 test-services postfix/cleanup[11571]: 5A4C34A4AC: message-id=<20101229124829.5a4c34a...@[edited]> Dec 29 13:48:29 test-services postfix/qmgr[2304]: 5A4C34A4AC: from=<r...@[edited]>, size=323, nrcpt=1 (queue active) Dec 29 13:48:29 test-services postfix/smtpd[11576]: connect from localhost[127.0.0.1] Dec 29 13:48:29 test-services postfix/smtpd[11576]: C9E0A4A4AB: client=localhost[127.0.0.1] Dec 29 13:48:29 test-services postfix/cleanup[11571]: C9E0A4A4AB: message-id=<20101229124829.5a4c34a...@[edited]> Dec 29 13:48:29 test-services postfix/qmgr[2304]: C9E0A4A4AB: from=<r...@[edited]>, size=978, nrcpt=1 (queue active) Dec 29 13:48:29 test-services amavis[11240]: (11240-01) Passed CLEAN, <r...@[edited]> -> <t...@[edited]>, Message-ID: <20101229124829.5a4c34a...@[edited]>, mail_id: Q7VOhybYx38B, Hits: 0.729, size: 323, queued_as: C9E0A4A4AB, 513 ms Dec 29 13:48:29 test-services postfix/smtp[11573]: 5A4C34A4AC: to=<t...@[edited]>, relay=127.0.0.1[127.0.0.1]:10024, delay=1.8, delays=1.2/0.01/0.03/0.5, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=11240-01, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as C9E0A4A4AB) Dec 29 13:48:29 test-services postfix/qmgr[2304]: 5A4C34A4AC: removed Dec 29 13:48:30 test-services dovecot: deliver(t...@[edited]): sieve: msgid=<20101229124829.5a4c34a...@[edited]>: stored mail into mailbox 'INBOX' Dec 29 13:48:30 test-services postfix/pipe[11577]: C9E0A4A4AB: to=<t...@[edited]>, relay=dovecot, delay=0.2, delays=0.05/0.03/0/0.11, dsn=2.0.0, status=sent (delivered via dovecot service) Dec 29 13:48:30 test-services postfix/qmgr[2304]: C9E0A4A4AB: removed Dec 29 13:48:30 test-services postfix/pickup[9435]: 77C114A4AC: uid=0 from=<root> Dec 29 13:48:30 test-services postfix/cleanup[11571]: 77C114A4AC: message-id=<20101229124830.77c114a...@[edited]> Dec 29 13:48:30 test-services postfix/qmgr[2304]: 77C114A4AC: from=<r...@[edited]>, size=330, nrcpt=1 (queue active) Dec 29 13:48:30 test-services postfix/smtpd[11593]: connect from localhost[127.0.0.1] Dec 29 13:48:30 test-services postfix/smtpd[11593]: C41EE4A4AB: client=localhost[127.0.0.1] Dec 29 13:48:30 test-services postfix/cleanup[11571]: C41EE4A4AB: message-id=<20101229124830.77c114a...@[edited]> Dec 29 13:48:30 test-services postfix/qmgr[2304]: C41EE4A4AB: from=<r...@[edited]>, size=820, nrcpt=1 (queue active) Dec 29 13:48:30 test-services postfix/smtpd[11593]: disconnect from localhost[127.0.0.1] Dec 29 13:48:30 test-services amavis[11239]: (11239-02) Passed CLEAN, <r...@[edited]> -> <al...@[edited]>, Message-ID: <20101229124830.77c114a...@[edited]>, mail_id: m-auTW37yQW6, Hits: -0.001, size: 330, queued_as: C41EE4A4AB, 348 ms Dec 29 13:48:30 test-services postfix/smtp[11573]: 77C114A4AC: to=<al...@[edited]>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.38, delays=0.02/0/0.02/0.34, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=11239-02, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as C41EE4A4AB) Dec 29 13:48:30 test-services postfix/qmgr[2304]: 77C114A4AC: removed Dec 29 13:48:30 test-services dovecot: deliver(t...@[edited]): sieve: msgid=<20101229124830.77c114a...@[edited]>: stored mail into mailbox 'INBOX' Dec 29 13:48:30 test-services postfix/pipe[11577]: C41EE4A4AB: to=<t...@[edited]>, orig_to=<al...@[edited]>, relay=dovecot, delay=0.07, delays=0.03/0/0/0.04, dsn=2.0.0, status=sent (delivered via dovecot service) Dec 29 13:48:30 test-services postfix/qmgr[2304]: C41EE4A4AB: removed Dec 29 13:48:31 test-services postfix/pickup[9435]: 9DEF84A4AC: uid=0 from=<root> Dec 29 13:48:31 test-services postfix/cleanup[11571]: 9DEF84A4AC: message-id=<20101229124831.9def84a...@[edited]> Dec 29 13:48:31 test-services postfix/qmgr[2304]: 9DEF84A4AC: from=<r...@[edited]>, size=1136, nrcpt=1 (queue active) Dec 29 13:48:31 test-services postfix/smtpd[11576]: BE5EC4A4AB: client=localhost[127.0.0.1] Dec 29 13:48:31 test-services postfix/cleanup[11571]: BE5EC4A4AB: message-id=<20101229124831.9def84a...@[edited]> Dec 29 13:48:31 test-services postfix/qmgr[2304]: BE5EC4A4AB: from=<r...@[edited]>, size=1917, nrcpt=1 (queue active) Dec 29 13:48:31 test-services amavis[11240]: (11240-02) Passed SPAM, <r...@[edited]> -> <t...@[edited]>, quarantine: k/spam-kEzi169drbKm.gz, Message-ID: <20101229124831.9def84a...@[edited]>, mail_id: kEzi169drbKm, Hits: 1000.729, size: 1136, queued_as: BE5EC4A4AB, 178 ms Dec 29 13:48:31 test-services postfix/smtp[11573]: 9DEF84A4AC: to=<t...@[edited]>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.23, delays=0.04/0/0.01/0.18, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=11240-02, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as BE5EC4A4AB) Dec 29 13:48:31 test-services postfix/qmgr[2304]: 9DEF84A4AC: removed Dec 29 13:48:31 test-services dovecot: deliver(t...@[edited]): sieve: msgid=<20101229124831.9def84a...@[edited]>: stored mail into mailbox 'Spam' Dec 29 13:48:31 test-services postfix/pipe[11577]: BE5EC4A4AB: to=<t...@[edited]>, relay=dovecot, delay=0.17, delays=0.03/0/0/0.14, dsn=2.0.0, status=sent (delivered via dovecot service) Dec 29 13:48:31 test-services postfix/qmgr[2304]: BE5EC4A4AB: removed Dec 29 13:48:32 test-services postfix/pickup[9435]: CA6334A4AC: uid=0 from=<root> Dec 29 13:48:32 test-services postfix/cleanup[11571]: CA6334A4AC: message-id=<20101229124832.ca6334a...@[edited]> Dec 29 13:48:32 test-services postfix/qmgr[2304]: CA6334A4AC: from=<r...@[edited]>, size=1148, nrcpt=1 (queue active) Dec 29 13:48:32 test-services postfix/smtpd[11593]: connect from localhost[127.0.0.1] Dec 29 13:48:32 test-services postfix/smtpd[11593]: EC3BD4A4AB: client=localhost[127.0.0.1] Dec 29 13:48:32 test-services postfix/cleanup[11571]: EC3BD4A4AB: message-id=<20101229124832.ca6334a...@[edited]> Dec 29 13:48:32 test-services postfix/qmgr[2304]: EC3BD4A4AB: from=<r...@[edited]>, size=1638, nrcpt=1 (queue active) Dec 29 13:48:33 test-services amavis[11239]: (11239-03) Passed SPAM, <r...@[edited]> -> <al...@[edited]>, quarantine: L/spam-L9OJuBX5JIAS.gz, Message-ID: <20101229124832.ca6334a...@[edited]>, mail_id: L9OJuBX5JIAS, Hits: 1000.729, size: 1148, queued_as: EC3BD4A4AB, 170 ms Dec 29 13:48:33 test-services postfix/smtp[11573]: CA6334A4AC: to=<al...@[edited]>, relay=127.0.0.1[127.0.0.1]:10024, delay=0.2, delays=0.02/0/0.01/0.18, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=11239-03, from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as EC3BD4A4AB) Dec 29 13:48:33 test-services postfix/qmgr[2304]: CA6334A4AC: removed Dec 29 13:48:33 test-services dovecot: deliver(t...@[edited]): sieve: msgid=<20101229124832.ca6334a...@[edited]>: stored mail into mailbox 'INBOX' Dec 29 13:48:33 test-services postfix/pipe[11577]: EC3BD4A4AB: to=<t...@[edited]>, orig_to=<al...@[edited]>, relay=dovecot, delay=0.08, delays=0.02/0/0/0.06, dsn=2.0.0, status=sent (delivered via dovecot service) Dec 29 13:48:33 test-services postfix/qmgr[2304]: EC3BD4A4AB: removed My master.cf: smtp inet n - - - - smtpd pickup fifo n - - 60 1 pickup cleanup unix n - - - 0 cleanup qmgr fifo n - n 300 1 qmgr tlsmgr unix - - - 1000? 1 tlsmgr rewrite unix - - - - - trivial-rewrite bounce unix - - - - 0 bounce defer unix - - - - 0 bounce trace unix - - - - 0 bounce verify unix - - - - 1 verify flush unix n - - 1000? 0 flush proxymap unix - - n - - proxymap proxywrite unix - - n - 1 proxymap smtp unix - - - - - smtp relay unix - - - - - smtp -o smtp_fallback_relay= showq unix n - - - - showq error unix - - - - - error retry unix - - - - - error discard unix - - - - - discard local unix - n n - - local virtual unix - n n - - virtual lmtp unix - - - - - lmtp anvil unix - - - - 1 anvil scache unix - - - - 1 scache maildrop unix - n n - - pipe flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient} uucp unix - n n - - pipe flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient) ifmail unix - n n - - pipe flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient) bsmtp unix - n n - - pipe flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient scalemail-backend unix - n n - 2 pipe flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension} mailman unix - n n - - pipe flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user} dovecot unix - n n - - pipe flags=DRhu user=vmail:vmail argv=/usr/lib/dovecot/deliver -d ${recipient} smtp-amavis unix - - n - 2 smtp -o smtp_data_done_timeout=1200 -o smtp_send_xforward_command=yes -o disable_dns_lookups=yes -o max_use=20 127.0.0.1:10025 inet n - - - - smtpd -o content_filter= -o local_recipient_maps= -o relay_recipient_maps= -o smtpd_restriction_classes= -o smtpd_delay_reject=no -o smtpd_client_restrictions=permit_mynetworks,reject -o smtpd_helo_restrictions= -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o smtpd_data_restrictions=reject_unauth_pipelining -o smtpd_end_of_data_restrictions= -o mynetworks=127.0.0.0/8 -o smtpd_error_sleep_time=0 -o smtpd_soft_error_limit=1001 -o smtpd_hard_error_limit=1000 -o smtpd_client_connection_count_limit=0 -o smtpd_client_connection_rate_limit=0 -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks -o local_header_rewrite_clients= My main.cf: smtpd_banner = $myhostname ESMTP $mail_name biff = no append_dot_mydomain = no readme_directory = no # Host setup myhostname = [EDITED] alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = [EDITED] mydestination = localhost relayhost = mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.100.0/24 mailbox_size_limit = 0 recipient_delimiter = inet_interfaces = all home_mailbox = Maildir/ local_recipient_maps = delay_warning_time = 12h maximal_queue_lifetime = 5d bounce_queue_lifetime = 5d message_size_limit = 20480000 # Virtual users setup virtual_transport = dovecot dovecot_destination_recipient_limit = 1 virtual_alias_maps = ldap:/etc/postfix/ldap-aliases.cf,ldap:/etc/postfix/ldap-mail2mail.cf virtual_mailbox_domains = ldap:/etc/postfix/ldap-domains.cf virtual_mailbox_maps = ldap:/etc/postfix/ldap-mailboxes.cf virtual_mailbox_base = /home/vmail virtual_uid_maps = static:2020 virtual_gid_maps = static:2020 virtual_mailbox_limit = 0 # SMTP smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth smtpd_sasl_auth_enable = yes smtpd_sasl_authenticated_header = yes smtpd_use_tls = yes smtpd_tls_auth_only = yes smtpd_tls_cert_file = /etc/ssl/certs/postfix.pem smtpd_tls_key_file = /etc/ssl/private/postfix.pem smtpd_helo_required = yes strict_rfc821_envelopes = yes disable_vrfy_command = yes smtpd_delay_reject = yes smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_invalid_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unknown_sender_domain, reject_unknown_recipient_domain, reject_unauth_pipelining, reject_rbl_client cbl.abuseat.org, reject_rbl_client zen.spamhaus.org, reject_rbl_client bl.spamcop.net, reject_rbl_client psbl.surriel.com, reject_rhsbl_sender dsn.rfc-ignorant.org, reject_rbl_client blackholes.easynet.nl, reject_rbl_client dnsbl.njabl.org, permit_mx_backup, permit content_filter = smtp-amavis:[127.0.0.1]:10024 receive_override_options = no_address_mappings