Hi guys,
I'm chasing my tail on this one. The setup is pretty simple virtual
hosting, with virtual_alias_maps in a file 'virtuals' which works fine,
except for one line:
b...@example.com bob, john, dave
When sending a mail to b...@example.com, bob receives one copy of the
mail, but john and dave each receives two. I understand the problem:
postfix does the recipient expansion, sends it off to spamassassin.
Spamassassin requeues the mail via the sendmail binary, so postfix
treats it as a new mail.
The log goes something like this (I separated the before and after parts
for easier reading):
Feb 26 13:26:24 mail postfix/smtpd[21425]: connect from
mx1.some_host.com[XXX.xxx.XXX.xxx]
Feb 26 13:26:24 mail postfix/smtpd[21425]: E0C6F9614DC:
client=mx1.some_host.com[XXX.xxx.XXX.xxx]
Feb 26 13:26:24 mail postfix/cleanup[21427]: E0C6F9614DC:
message-id=<1235651181.6478.13.ca...@kula>
Feb 26 13:26:24 mail postfix/qmgr[23052]: E0C6F9614DC:
from=<pe...@some_host.com>, size=1560, nrcpt=3 (queue active)
Feb 26 13:26:24 mail postfix/smtpd[21425]: disconnect from
mx1.some_host.com[XXX.xxx.XXX.xxx]
Feb 26 13:26:29 mail postfix/pipe[21354]: E0C6F9614DC:
to=<j...@example.com>, orig_to=<b...@example.com>, relay=spamassassin,
delay=4.9, delays=0.17
/0/0/4.7, dsn=2.0.0, status=sent (delivered via spamassassin service)
Feb 26 13:26:29 mail postfix/pipe[21354]: E0C6F9614DC:
to=<b...@example.com>, relay=spamassassin, delay=4.9,
delays=0.17/0/0/4.7, dsn=2.0.0, status=sen
t (delivered via spamassassin service)
Feb 26 13:26:29 mail postfix/pipe[21354]: E0C6F9614DC:
to=<d...@example.com>, orig_to=<b...@example.com>, relay=spamassassin,
delay=4.9, delays=0.17/
0/0/4.7, dsn=2.0.0, status=sent (delivered via spamassassin service)
Feb 26 13:26:29 mail postfix/qmgr[23052]: E0C6F9614DC: removed
Feb 26 13:26:24 mail spamd[21308]: spamd: connection from localhost
[127.0.0.1] at port 42070
Feb 26 13:26:24 mail spamd[21308]: spamd: setuid to spamassassin succeeded
Feb 26 13:26:24 mail spamd[21308]: spamd: processing message
<1235651181.6478.13.ca...@kula> for spamassassin:511
Feb 26 13:26:29 mail spamd[21308]: spamd: clean message (-2.2/5.0) for
spamassassin:511 in 4.7 seconds, 1522 bytes.
Feb 26 13:26:29 mail spamd[21308]: spamd: result: . -2 - AWL,BAYES_00
scantime=4.7,size=1522,user=spamassassin,uid=511,required_score=5.0,rhost=localhost,
raddr=127.0.0.1,rport=42070,mid=<1235651181.6478.13.ca...@kula>,bayes=0.000000,autolearn=ham
Feb 26 13:26:29 mail postfix/pickup[18649]: A18069614F3: uid=511
from=<pe...@some_host.com>
Feb 26 13:26:29 mail postfix/cleanup[21427]: A18069614F3:
message-id=<1235651181.6478.13.ca...@kula>
Feb 26 13:26:29 mail postfix/qmgr[23052]: A18069614F3:
from=<pe...@some_host.com>, size=1880, nrcpt=5 (queue active)
Feb 26 13:26:29 mail postfix/local[21364]: A18069614F3:
to=<j...@example.com>, relay=local, delay=0.01, delays=0.01/0/0/0,
dsn=2.0.0, status=sent (deli
vered to maildir)
Feb 26 13:26:29 mail postfix/local[21368]: A18069614F3:
to=<b...@example.com>, relay=local, delay=0.01, delays=0.01/0/0/0,
dsn=2.0.0, status=sent (deli
vered to maildir)
Feb 26 13:26:29 mail postfix/local[21364]: A18069614F3:
to=<d...@example.com>, orig_to=<b...@example.com>, relay=local,
delay=0.02, delays=0.01/0/0/0
, dsn=2.0.0, status=sent (delivered to maildir)
Feb 26 13:26:29 mail postfix/local[21368]: A18069614F3:
to=<j...@example.com>, orig_to=<b...@example.com>, relay=local,
delay=0.02, delays=0.01/0/0/
0, dsn=2.0.0, status=sent (delivered to maildir)
Feb 26 13:26:29 mail postfix/local[21435]: A18069614F3:
to=<d...@example.com>, relay=local, delay=0.02, delays=0.01/0.01/0/0,
dsn=2.0.0, status=sent (de
livered to maildir)
Feb 26 13:26:29 mail postfix/qmgr[23052]: A18069614F3: removed
I tried setting receive_override_options = no_address_mappings but this
kills address expansion both before and after filtering. Is there a
way to disable it only on one side of the content_filter?
Config is included at the bottom.
Thanks
--kj
# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailbox_size_limit = 256000000
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = hash:/etc/postfix/mydomains
mydomain = example.com
mynetworks = , 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_sasl_security_options = noplaintext
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_recipient_restrictions = permit_sasl_authenticated,
permit_mynetworks, reject_unauth_destination, reject_rbl_client
zen.spamhaus.org
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
unknown_local_recipient_reject_code = 550
virtual_alias_domains = mail.example.com
virtual_alias_maps = hash:/etc/postfix/virtual
Spamassassin is integrated with the followingin master.conf:
smtp inet n - n - - smtpd
-o content_filter=spamassassin
......
spamassassin unix - n n - - pipe
user=spamassassin argv=/usr/bin/spamc -f -e
/usr/sbin/sendmail -oi -f ${sender} ${recipient}