为了只通过 "认证邮箱"(意大利的PEC系统,一种 "注册邮件 "的形式)发送某些邮件,我们使用了这样的设置。
main.cf
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sender_dependent_authentication = yes
sender_dependent_default_transport_maps = hash:/etc/postfix/sender_relay
sender_relay
@first.tld relay-smtps:smtps.our-provider.tld:465
@second.tld relay-smtps:smtps.our-provider.tld:465
sasl_passwd
[email protected] [email protected]:PASSWORD
[email protected] [email protected]:PASSWORD
只要你只向一个收件人发送邮件,这就很好用。
但是当我们把它们发送给不同的收件人时,我们的同行就会抱怨说,在To和Cc中指定的地址与实际应该存在的地址不匹配(转发路径)。
这意味着什么,最好的解释就是这段mail.log的最后4行。
May 13 16:43:15 ourhostname postfix/qmgr[21826]: 153821434F6: removed
May 13 16:43:18 ourhostname postfix/smtpd[28249]: connect from internal.server.tld[10.20.30.40]
May 13 16:43:18 ourhostname postfix/smtpd[28249]: 81B971434F6: client=internal.server.tld[10.20.30.40]
May 13 16:43:18 ourhostname postfix/cleanup[28252]: 81B971434F6: message-id=<[email protected]>
May 13 16:43:18 ourhostname postfix/qmgr[21826]: 81B971434F6: from=<[email protected]>, size=2549002, nrcpt=1 (queue active)
May 13 16:43:18 ourhostname postfix/smtpd[28249]: 8D064143527: client=internal.server.tld[10.20.30.40]
May 13 16:43:18 ourhostname postfix/cleanup[28252]: 8D064143527: message-id=<[email protected]>
May 13 16:43:18 ourhostname postfix/qmgr[21826]: 8D064143527: from=<[email protected]>, size=2548877, nrcpt=1 (queue active)
May 13 16:43:18 ourhostname postfix/smtpd[28249]: disconnect from internal.server.tld[10.20.30.40] ehlo=2 starttls=1 mail=2 rcpt=2 data=2 quit=1 commands=10
May 13 16:43:20 ourhostname postfix/relay-smtps/smtp[28635]: 8D064143527: to=<[email protected]>, relay=smtps.our-provider.tld[1.1.1.1]:465, delay=1.7, delays=0.05/0.01/0.56/1.1, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 49McqH4wCMz2LfNLM)
May 13 16:43:20 ourhostname postfix/qmgr[21826]: 8D064143527: removed
May 13 16:43:20 ourhostname postfix/relay-smtps/smtp[28634]: 81B971434F6: to=<[email protected]>, relay=smtps.our-provider.tld[1.1.1.1]:465, delay=1.8, delays=0.05/0.01/0.62/1.2, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 49McqH4y1Rz2MKHTD)
May 13 16:43:20 ourhostname postfix/qmgr[21826]: 81B971434F6: removed
正如你所看到的,邮件被分割开来,并且每个邮件都会被送出(两个收件人--两次送出)。
有什么办法可以避免这种情况吗?
我的错... 我忽略了Postfix一直在接收已经被内部邮件服务器分成两份的邮件。disconnect from internal.server.tld[10.20.30.40] ehlo=2 starttls=1 mail=2 rcpt=2 data=2 quit=1 commands=10
.