lwydata 写道:

印象中 enable_original_recipient=no 才不会有重覆 mail 出现

所有觉得这个问题很奇怪,而且至今不知道如何能做到重现,只有偶尔有用户会反应

ZhangHuangbin 写道:

麻烦贴一下 "postconf -n" 命令的输出。

postconf -n的输出

alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
allow_min_user = no
biff = no
bounce_queue_lifetime = 1d
bounce_template_file = /etc/postfix/bounce.cf
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
delay_warning_time = 0h
disable_vrfy_command = yes
enable_original_recipient = no
header_checks = regexp:/etc/postfix/header_checks    pcre:/etc/postfix/header_checks.pcre
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_name = Postfix
mail_owner = postfix
mailbox_command = /usr/libexec/dovecot/deliver
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
maximal_backoff_time = 4000s
maximal_queue_lifetime = 1d
message_size_limit = 31457280
milter_default_action = tempfail
minimal_backoff_time = 300s
mydestination = $myhostname, localhost, localhost.localdomain, localhost.$myhostname,
localhost.$mydomain
mydomain = domain.cn
myhostname = mail.domain.cn
mynetworks = 127.0.0.1, 172.16.0.0/16
mynetworks_style = subnet
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
proxy_read_maps = $canonical_maps    $lmtp_generic_maps    $local_recipient_maps   
$mydestination    $mynetworks    $recipient_bcc_maps    $recipient_canonical_maps   
$relay_domains    $relay_recipient_maps    $relocated_maps    $sender_bcc_maps   
$sender_canonical_maps    $smtp_generic_maps    $smtpd_sender_login_maps    $transport_maps   
$virtual_alias_domains    $virtual_alias_maps    $virtual_mailbox_domains   
$virtual_mailbox_maps
queue_directory = /var/spool/postfix
queue_run_delay = 300s
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
recipient_bcc_maps = pcre:/etc/postfix/recipient_bcc.pcre
recipient_delimiter = +
relay_domains = domain.cn
relocated_maps = hash:/etc/postfix/relocated
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sender_bcc_maps = pcre:/etc/postfix/sender_bcc.pcre
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_data_init_timeout = 240s
smtp_data_xfer_timeout = 600s
smtp_tls_policy_maps = hash:/etc/postfix/tls_policy_maps
smtp_use_tls = yes
smtpd_client_restrictions = check_client_access hash:/etc/postfix/access/client_access
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_delay_reject = yes
smtpd_enforce_tls = yes
smtpd_error_sleep_time = 1s
smtpd_hard_error_limit = 20
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks    permit_sasl_authenticated   
check_helo_access pcre:/etc/postfix/helo_access.pcre
smtpd_milters = inet:172.16.0.151:8092
smtpd_recipient_limit = 1000
smtpd_recipient_restrictions = permit_mynetworks    reject_unknown_sender_domain   
reject_unknown_recipient_domain    reject_non_fqdn_sender    reject_non_fqdn_recipient   
reject_unlisted_recipientpermit_sasl_authenticated    reject_unauth_destination   
reject_non_fqdn_helo_hostname    reject_invalid_helo_hostname
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes
smtpd_restriction_classes = local_only
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = no
smtpd_sasl_local_domain = $mydomain
smtpd_sasl_path = ./dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = ldap:/etc/postfix/ad/sender_login_maps.cf
smtpd_sender_restrictions = permit_mynetworks    reject_sender_login_mismatch   
permit_sasl_authenticated    check_recipient_access hash:/etc/postfix/local_recipient
smtpd_soft_error_limit = 10
smtpd_tls_CAfile = /etc/pki/mail1/domain.cn.crt
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/pki/mail1/domain.cn.crt
smtpd_tls_key_file = /etc/pki/mail1/domain.cn.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
soft_bounce = no
tls_random_source = dev:/dev/urandom
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
virtual_alias_maps = regexp:/etc/postfix/virtual   
ldap:/etc/postfix/ad/virtual_group_maps.cf
virtual_gid_maps = static:500
virtual_mailbox_base = /var/vmail
virtual_mailbox_maps = ldap:/etc/postfix/ad/virtual_mailbox_maps.cf
virtual_minimum_uid = 500
virtual_transport = dovecot
virtual_uid_maps = static:500

补充一下,我的环境是
postfix+dovecot+roundcube+AD,没有用默认的mysql或者LDAP,邮件账户和域账号集成在一起

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本:
- 使用的 Linux/BSD 发行版名称及版本号:
- 与您的问题相关的日志信息:
==== iRedMail版本:iRedMail-0.7.4
OS:CentOS 6.2 x86_64

日志:
Jan 29 18:51:00 mail postfix/smtpd[12082]: connect from unknown[172.16.1.6]
Jan 29 18:51:00 mail postfix/smtpd[12082]: AD57735E2B4: client=unknown[172.16.1.6], sasl_method=LOGIN, sasl_username=send_user@domain.cn
Jan 29 18:51:00 mail postfix/cleanup[14609]: AD57735E2B4: message-id=<02ff01cdfe0e$58ce1330$0a6a3990$@domain.cn>
Jan 29 18:51:01 mail postfix/qmgr[12770]: AD57735E2B4: from=<send_user@domain.cn>, size=74727, nrcpt=5 (queue active)
Jan 29 18:51:01 mail postfix/smtpd[12082]: 4602C35E2D4: client=unknown[172.16.1.6], sasl_method=LOGIN, sasl_username=send_user@domain.cn
Jan 29 18:51:01 mail postfix/cleanup[14707]: 4602C35E2D4: message-id=<030401cdfe0e$59242270$0b6c6750$@domain.cn>
Jan 29 18:51:01 mail postfix/qmgr[12770]: 4602C35E2D4: from=<send_user@domain.cn>, size=36929, nrcpt=1 (queue active)
Jan 29 18:51:01 mail postfix/pipe[15049]: AD57735E2B4: to=<rcpt_user@domain.cn>, relay=dovecot, delay=0.94, delays=0.57/0.01/0/0.36, dsn=2.0.0, status=sent (delivered via dovecot service)
Jan 29 18:51:01 mail postfix/pipe[15212]: AD57735E2B4: to=<rcpt_user1@domain.cn>, relay=dovecot, delay=0.95, delays=0.57/0.01/0/0.37, dsn=2.0.0, status=sent (delivered via dovecot service)
Jan 29 18:51:01 mail postfix/pipe[15131]: 4602C35E2D4: to=<rcpt_user@domain.cn>, relay=dovecot, delay=0.41, delays=0.14/0/0/0.27, dsn=2.0.0, status=sent (delivered via dovecot service)
Jan 29 18:51:01 mail postfix/qmgr[12770]: 4602C35E2D4: removed
Jan 29 18:51:01 mail postfix/qmgr[12770]: AD57735E2B4: removed

问题描述:
发件人:send_user@domain.cn,客户端为outlook或者exchange服务器
收件人:rcpt_user@doamin.cn
抄送:mailgroup@domain.cn(为邮件组),邮件组里包括rcpt_user@domain.cn和rcpt_user1@doamin.cn两个用户
rcpt_user@domain.cn收到两封一样的邮件

类似以上的情况,当收件人和抄送同时都存在某个用户时,重复的这个收件人(如问题描述中的rcpt_user@domain.cn)有可能收到两封一样的邮件,从日志中看,有两个smtpd进程和send_user进行通信,这个问题不能重现,只有偶尔会发生。说明一下,postfix的enable_original_recipient = no 已经设置

请张工帮忙分析分析,这个问题会不会跟Outlook或者exchange的设置有关系,还是postfix的原因,或者postfix配置能不能避免这个问题,我在Outlook下做了一些实验,都不能100%重现这个问题

试过其他的邮件客户端,用web登陆也是这个问题,最奇怪的是对方同一个人同时发的同一封邮件给几个人,其中有一个人收到的邮件内嵌的图片不显示,全变成了附件,主帖中的日志就是没TLS加密和有TLS加密是的日志

以下是Nicholas@A.com将同一封邮件同时发给user01@B.com和user02@B.com两个人的日志(TO:user01@B.com;user02@B.com,服务器mail.B.com上的日志,邮件系统为iredmail,对方邮件系统未知),Nicholas@A.com发出的同一封邮件服务器日志显示收到却是两封大小不一样的,user01收到的邮件内嵌正文的图片不显示(outlook和web方式都不显示,可排除outlook客户端的设置问题),user02显示正常,日志如下:

1、postfix不启用对TLS支持的情况下:

Dec  6 11:17:45 mail postfix/smtpd[28633]: connect from mail.A.com[12.34.56.78]
Dec  6 11:17:47 mail postfix/smtpd[28633]: 25C6DCD230: client=mail.A.com[12.34.56.78]
Dec  6 11:17:48 mail postfix/cleanup[21920]: 25C6DCD230: message-id=E124CB5E-2697-4EB6-B718-6E6C32BF43AF@A.com
Dec  6 11:17:48 mail postfix/qmgr[11849]: 25C6DCD230: from=<Nicholas@A.com>, size=36227, nrcpt=3 (queue active)
Dec  6 11:17:48 mail postfix/pipe[28700]: 25C6DCD230: to=<user01@B.cn>, relay=dovecot, delay=1.5, delays=1.5/0/0/0.04, dsn=2.0.0, status=sent (delivered via dovecot service)
Dec  6 11:17:48 mail postfix/qmgr[11849]: 25C6DCD230: removed

Dec  6 11:17:48 mail postfix/smtpd[28633]: DF01BCD230: client=mail.A.com[12.34.56.78]
Dec  6 11:17:49 mail postfix/cleanup[27855]: DF01BCD230: message-id=<E124CB5E-2697-4EB6-B718-6E6C32BF43AF@A.com>
Dec  6 11:17:49 mail postfix/qmgr[11849]: DF01BCD230: from=<Nicholas@A.com>, size=32055, nrcpt=12 (queue active)
Dec  6 11:17:49 mail postfix/pipe[28705]: DF01BCD230: to=<user02@B.cn>, relay=dovecot, delay=1, delays=0.92/0.02/0/0.09, dsn=2.0.0, status=sent (delivered via dovecot service)
Dec  6 11:17:49 mail postfix/qmgr[11849]: DF01BCD230: removed

2、postfix启用对TLS的支持,对方服务器连接时多了TLS连接:

Dec  5 09:24:37 mail postfix/smtpd[6654]: connect from mail.A.com[12.34.56.78]
Dec  5 09:24:38 mail postfix/smtpd[6654]: setting up TLS connection from mail.A.com[12.34.56.78]
Dec  5 09:24:39 mail postfix/smtpd[6654]: Anonymous TLS connection established from mail.A.com[12.34.56.78]: TLSv1 with cipher RC4-MD5 (128/128 bits)
Dec  5 09:24:39 mail postfix/smtpd[6654]: 9C503CD55F: client=mail.A.com[12.34.56.78]
Dec  5 09:24:40 mail postfix/cleanup[6656]: 9C503CD55F: message-id=<46888868C6A9E14BA5034308B17B8FAE1699C9AFA3@EXCH1.A.com>
Dec  5 09:24:41 mail postfix/qmgr[8743]: 9C503CD55F: from=<Nicholas@A.com>, size=81213, nrcpt=2 (queue active)
Dec  5 09:24:41 mail postfix/pipe[6398]: 9C503CD55F: to=<user01@B.cn>, relay=dovecot, delay=2, delays=2/0/0/0.02, dsn=2.0.0, status=sent (delivered via dovecot service)
Dec  5 09:24:41 mail postfix/qmgr[8743]: 9C503CD55F: removed
Dec  5 09:24:41 mail postfix/smtpd[6654]: E569BCD55F: client=mail.A.com[12.34.56.78]
Dec  5 09:24:42 mail postfix/cleanup[6371]: E569BCD55F: message-id=<46888868C6A9E14BA5034308B17B8FAE1699C9AFA3@EXCH1.A.com>
Dec  5 09:24:43 mail postfix/qmgr[8743]: E569BCD55F: from=<Nicholas@A.com>, size=76501, nrcpt=2 (queue active)
Dec  5 09:24:43 mail postfix/pipe[6414]: E569BCD55F: to=<user02@B.cn>, relay=dovecot, delay=1.5, delays=1.5/0/0/0.05, dsn=2.0.0, status=sent (delivered via dovecot service)
Dec  5 09:24:43 mail postfix/qmgr[8743]: E569BCD55F: removed


问题:
1、对方用户将同一封邮件发给己方多人,己方smtpd服务器收到对方smtp客户端(MTA)的邮件是一封还是多封?
2、如果是一封,像上面日志显示,为什么同一封邮件不同的人收到大小会不一样?
3、正文内嵌图片为什么会显示不正常,而且都变成附件?