主题: 今天遇到一个关于共享邮箱的奇怪的问题

==== 必填信息。没有填写将不予回复 ====
- iRedMail 版本号:0.9.0
- 使用哪个数据库存储用户帐号(OpenLDAP,MySQL,PostgreSQL):ad2008
- 使用的 Linux/BSD 发行版名称及版本号:centos6.6
- 与您的问题相关的日志信息:
====

今天我参照文档中的设置将vmail的INBOX共享给test2用户,然后web登陆vmail后在发信的地方却可以自由填写发件人地址了,而且能发送成功,以下是我的postconf -n结果,求解释
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
allow_min_user = no
allow_percent_hack = no
biff = no
bounce_queue_lifetime = 4h
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
delay_warning_time = 0h
disable_vrfy_command = yes
dovecot_destination_recipient_limit = 1
enable_original_recipient = no
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = all
lmtp_tls_mandatory_protocols = !SSLv2 !SSLv3
lmtp_tls_protocols = !SSLv2 !SSLv3
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 = 4h
message_size_limit = 36700160
minimal_backoff_time = 300s
mydestination = $myhostname, localhost, localhost.localdomain, localhost.$myhostname
mydomain = 517na.com
myhostname = mail2.test.com
mynetworks = 127.0.0.0/8
mynetworks_style = host
myorigin = test.com
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 $smtpd_sender_restrictions
queue_directory = /var/spool/postfix
queue_run_delay = 300s
readme_directory = /usr/share/doc/postfix-2.11.0/README_FILES
receive_override_options = no_address_mappings
recipient_bcc_maps =
recipient_delimiter = +
relay_domains =
relay_recipient_maps =
sample_directory = /usr/share/doc/postfix-2.11.0/samples
sender_bcc_maps =
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp-amavis_destination_recipient_limit = 1
smtp_data_init_timeout = 240s
smtp_data_xfer_timeout = 600s
smtp_tls_CAfile = $smtpd_tls_CAfile
smtp_tls_loglevel = 0
smtp_tls_mandatory_protocols = !SSLv2 !SSLv3
smtp_tls_note_starttls_offer = yes
smtp_tls_protocols = !SSLv2 !SSLv3
smtp_tls_security_level = may
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_end_of_data_restrictions = check_policy_service inet:127.0.0.1:10031,
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname, check_helo_access pcre:/etc/postfix/helo_access.pcre
smtpd_recipient_restrictions = reject_unlisted_recipient, check_policy_service inet:127.0.0.1:10031, permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_rbl_client sbl.spamhaus.org=127.0.0.2
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = test.com
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = proxy:ldap:/etc/postfix/ad_sender_login_maps.cf
smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated
smtpd_tls_CAfile = /etc/pki/tls/certs/iRedMail.crt
smtpd_tls_cert_file = /etc/pki/tls/certs/iRedMail.crt
smtpd_tls_key_file = /etc/pki/tls/private/iRedMail.key
smtpd_tls_loglevel = 0
smtpd_tls_mandatory_protocols = !SSLv2 !SSLv3
smtpd_tls_protocols = !SSLv2 !SSLv3
smtpd_tls_security_level = may
swap_bangpath = no
tls_random_source = dev:/dev/urandom
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = proxy:ldap:/etc/postfix/ad_virtual_group_maps.cf
virtual_gid_maps = static:2000
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = test.com
virtual_mailbox_maps = proxy:ldap:/etc/postfix/ad_virtual_mailbox_maps.cf
virtual_minimum_uid = 2000
virtual_transport = dovecot
virtual_uid_maps = static:2000

回复: 今天遇到一个关于共享邮箱的奇怪的问题

麻烦贴一下你用任意邮件地址作为发件人发送邮件之后 Postfix 日志里的相关日志。

回复: 今天遇到一个关于共享邮箱的奇怪的问题

example.com是我收件的域,原谅我把真实的地址改成了example,我用test2登录后填写的qq邮箱地址,发送到example.com,能收到,且显示的发信人是qq邮箱地址
Jan 11 14:40:36 mail postfix/smtpd[45403]: connect from localhost[127.0.0.1]
Jan 11 14:40:36 mail postfix/smtpd[45403]: EA3452007D1: client=localhost[127.0.0.1], sasl_method=LOGIN, sasl_username=test2@example.com.cn
Jan 11 14:40:37 mail postfix/cleanup[45495]: EA3452007D1: message-id=<17ff6d624f2305a90df590f7049d7707@example.com.cn>
Jan 11 14:40:37 mail postfix/qmgr[27929]: EA3452007D1: from=<634389716@qq.com>, size=520, nrcpt=1 (queue active)
Jan 11 14:40:37 mail roundcube: User test2@example.com.cn [172.17.42.45]; Message for fengwu@example.com; 250: 2.0.0 Ok: queued as EA3452007D1
Jan 11 14:40:37 mail postfix/smtpd[45403]: disconnect from localhost[127.0.0.1]
Jan 11 14:40:37 mail postfix/smtpd[45403]: connect from unknown[unknown]
Jan 11 14:40:37 mail postfix/smtpd[45403]: lost connection after CONNECT from unknown[unknown]
Jan 11 14:40:37 mail postfix/smtpd[45403]: disconnect from unknown[unknown]
Jan 11 14:40:37 mail postfix/smtpd[44921]: connect from unknown[172.17.42.155]
Jan 11 14:40:37 mail postfix/smtpd[44921]: lost connection after CONNECT from unknown[172.17.42.155]
Jan 11 14:40:37 mail postfix/smtpd[44921]: disconnect from unknown[172.17.42.155]
Jan 11 14:40:39 mail postfix/smtpd[45510]: connect from localhost[127.0.0.1]
Jan 11 14:40:39 mail postfix/smtpd[45510]: 3D0CE201948: client=localhost[127.0.0.1]
Jan 11 14:40:39 mail postfix/cleanup[45495]: 3D0CE201948: message-id=<17ff6d624f2305a90df590f7049d7707@example.com.cn>
Jan 11 14:40:39 mail postfix/qmgr[27929]: 3D0CE201948: from=<634389716@qq.com>, size=958, nrcpt=1 (queue active)
Jan 11 14:40:39 mail postfix/smtpd[45510]: disconnect from localhost[127.0.0.1]
Jan 11 14:40:39 mail amavis[50930]: (50930-20) Passed CLEAN {RelayedInternal}, MYNETS/MYUSERS LOCAL [127.0.0.1]:35051 <634389716@qq.com> -> <fengwu@example.com>, Queue-ID: EA3452007D1, Message-ID: <17ff6d624f2305a90df590f7049d7707@example.com.cn>, mail_id: oN0rTsy-akS3, Hits: -0.747, size: 520, queued_as: 3D0CE201948, 2172 ms
Jan 11 14:40:39 mail postfix/smtp[45496]: EA3452007D1: to=<fengwu@example.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=2.4, delays=0.13/0.06/0.01/2.2, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 3D0CE201948)
Jan 11 14:40:39 mail postfix/qmgr[27929]: EA3452007D1: removed
Jan 11 14:40:39 mail postfix/smtp[45511]: 3D0CE201948: to=<fengwu@example.com>, relay=mail.example.com[x.x.x.x]:25, delay=0.38, delays=0.01/0.03/0.16/0.18, dsn=2.6.0, status=sent (250 2.6.0 <17ff6d624f2305a90df590f7049d7707@example.com.cn> [InternalId=4027401] Queued mail for delivery)

回复: 今天遇到一个关于共享邮箱的奇怪的问题

example.com.cn是iredmail所在域

634389716 写道:

example.com是我收件的域,原谅我把真实的地址改成了example,我用test2登录后填写的qq邮箱地址,发送到example.com,能收到,且显示的发信人是qq邮箱地址
Jan 11 14:40:36 mail postfix/smtpd[45403]: connect from localhost[127.0.0.1]
Jan 11 14:40:36 mail postfix/smtpd[45403]: EA3452007D1: client=localhost[127.0.0.1], sasl_method=LOGIN, sasl_username=test2@example.com.cn
Jan 11 14:40:37 mail postfix/cleanup[45495]: EA3452007D1: message-id=<17ff6d624f2305a90df590f7049d7707@example.com.cn>
Jan 11 14:40:37 mail postfix/qmgr[27929]: EA3452007D1: from=<634389716@qq.com>, size=520, nrcpt=1 (queue active)
Jan 11 14:40:37 mail roundcube: User test2@example.com.cn [172.17.42.45]; Message for fengwu@example.com; 250: 2.0.0 Ok: queued as EA3452007D1
Jan 11 14:40:37 mail postfix/smtpd[45403]: disconnect from localhost[127.0.0.1]
Jan 11 14:40:37 mail postfix/smtpd[45403]: connect from unknown[unknown]
Jan 11 14:40:37 mail postfix/smtpd[45403]: lost connection after CONNECT from unknown[unknown]
Jan 11 14:40:37 mail postfix/smtpd[45403]: disconnect from unknown[unknown]
Jan 11 14:40:37 mail postfix/smtpd[44921]: connect from unknown[172.17.42.155]
Jan 11 14:40:37 mail postfix/smtpd[44921]: lost connection after CONNECT from unknown[172.17.42.155]
Jan 11 14:40:37 mail postfix/smtpd[44921]: disconnect from unknown[172.17.42.155]
Jan 11 14:40:39 mail postfix/smtpd[45510]: connect from localhost[127.0.0.1]
Jan 11 14:40:39 mail postfix/smtpd[45510]: 3D0CE201948: client=localhost[127.0.0.1]
Jan 11 14:40:39 mail postfix/cleanup[45495]: 3D0CE201948: message-id=<17ff6d624f2305a90df590f7049d7707@example.com.cn>
Jan 11 14:40:39 mail postfix/qmgr[27929]: 3D0CE201948: from=<634389716@qq.com>, size=958, nrcpt=1 (queue active)
Jan 11 14:40:39 mail postfix/smtpd[45510]: disconnect from localhost[127.0.0.1]
Jan 11 14:40:39 mail amavis[50930]: (50930-20) Passed CLEAN {RelayedInternal}, MYNETS/MYUSERS LOCAL [127.0.0.1]:35051 <634389716@qq.com> -> <fengwu@example.com>, Queue-ID: EA3452007D1, Message-ID: <17ff6d624f2305a90df590f7049d7707@example.com.cn>, mail_id: oN0rTsy-akS3, Hits: -0.747, size: 520, queued_as: 3D0CE201948, 2172 ms
Jan 11 14:40:39 mail postfix/smtp[45496]: EA3452007D1: to=<fengwu@example.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=2.4, delays=0.13/0.06/0.01/2.2, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 3D0CE201948)
Jan 11 14:40:39 mail postfix/qmgr[27929]: EA3452007D1: removed
Jan 11 14:40:39 mail postfix/smtp[45511]: 3D0CE201948: to=<fengwu@example.com>, relay=mail.example.com[x.x.x.x]:25, delay=0.38, delays=0.01/0.03/0.16/0.18, dsn=2.6.0, status=sent (250 2.6.0 <17ff6d624f2305a90df590f7049d7707@example.com.cn> [InternalId=4027401] Queued mail for delivery)

回复: 今天遇到一个关于共享邮箱的奇怪的问题

smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated

可能是因为 reject_sender_login_mismatch 在 permit_mynetworks 之前导致的。试试两者调换一下位置,重启 postfix 服务后再试试。