我在 centos 6 上使用 Dovecot 和 sendmail,它根据我的 Server 2012 R2 域进行身份验证。我可以使用所有用户帐户登录,但有两个用户销售和信息发送给 root 时出现问题。
我将它们从 /etc/aliases 中删除,并运行了 newaliases,这解决了邮件发送给 root 的问题,但现在当我发送这两封电子邮件时,用户会收到未知错误。
AD 中销售的用户名是 Sales,电子邮件是[电子邮件保护]当我发送电子邮件时,它告诉我用户不存在。AD 中的信息用户名是 Operations,电子邮件是[电子邮件保护]电子邮件至[电子邮件保护]发送成功但被退回 用户未知
[root@sogo domain.com]# cat /etc/dovecot-ldap.conf
hosts = CB2012r2DC:3268
dn = cn=Administrator,cn=Users,dc=cb,dc=local
dnpass = password
ldap_version = 3
base = dc=cb,dc=local
scope = subtree
auth_bind = yes
user_attrs = sAMAccountName=user
user_filter = (&(ObjectClass=person)(sAMAccountName=%u))
pass_filter = (&(ObjectClass=person)(sAMAccountName=%u))
pass_attrs = sAMAccountName=user
[root@sogo dovecot]# cat dovecot.conf
disable_plaintext_auth = no
info_log_path = /var/log/dovecot_lda.log
log_path = /var/log/dovecot_lda.log
log_timestamp = "%Y-%m-%d %H:%M:%S "
mail_gid = 500
mail_location = maildir:/home/vhostmail/domain.com/%u/Maildir
mail_privileged_group = mail
mail_uid = 500
mail_debug = yes
mail_plugins = acl
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date
#auth_verbose = yes
#auth_debug = yes
#auth_debug_passwords = yes
passdb {
args = /etc/dovecot-ldap.conf
driver = ldap
}
protocols = imap pop3 sieve
service auth {
unix_listener auth-client {
mode = 0600
}
unix_listener auth-master {
group = vhostmail
mode = 0600
user = vhostmail
}
user = root
}
service imap-login {
user = dovecot
}
protocol imap {
mail_plugins = $mail_plugins imap_acl
}
service pop3-login {
user = dovecot
# mail_plugins = acl imap_acl
}
ssl = no
userdb {
args = /etc/dovecot-ldap.conf
driver = ldap
}
protocol lda {
auth_socket_path = /var/run/dovecot/auth-master
hostname = localhost
mail_debug = yes
info_log_path = /var/log/dovecot_lda.log
log_path = /var/log/dovecot_lda.log
mail_plugin_dir = /usr/lib/dovecot
mail_plugins = sieve
postmaster_address = [email protected]
sendmail_path = /usr/lib/sendmail
}
service managesieve-login {
user = dovecot
inet_listener sieve {
port = 4190
}
protocol sieve {
#managesieve_logout_format = bytes=%i/%o
#managesieve_implementation_string = Dovecot Pigeonhole
#managesieve_implementation_string = Cyrus timsieved v2.2.13
}
}
plugin {
# Used by both the Sieve plugin and the ManageSieve protocol
sieve = /home/vhostmail/domain.com/%u/.dovecot.sieve
sieve_dir = /home/vhostmail/domain.com/%u/sieve
}
仅当您发送至信息时才会退回邮件,销售永远不会收到邮件
The original message was received at Sat, 24 Sep 2016 16:20:22 +0200
from localhost.localdomain [127.0.0.1]
----- The following addresses had permanent fatal errors -----
<[email protected]>
(reason: User unknown)
----- Transcript of session follows -----
550 5.1.1 <[email protected]>... User unknown
Reporting-MTA: dns; sogo.domain.com
Received-From-MTA: DNS; localhost.localdomain
Arrival-Date: Sat, 24 Sep 2016 16:20:22 +0200
Final-Recipient: RFC822; [email protected]
X-Actual-Recipient: RFC822; [email protected]
Action: failed
Status: 5.1.1
Diagnostic-Code: X-Unix; 67
Last-Attempt-Date: Sat, 24 Sep 2016 16:20:23 +0200
我发送了一封电子邮件[电子邮件保护]到[电子邮件保护]以及一个[电子邮件保护]到[电子邮件保护]
这是邮件日志
Sep 24 19:08:19 sogo sendmail[1579]: u8OH8IGB001579: from= <[email protected]>, size=772, class=0, nrcpts=1, msgid=<269-57e6b300-f- 26620080@66074461>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Sep 24 19:08:20 sogo sendmail[1581]: u8OH8IGB001579: to= <[email protected]>, delay=00:00:01, xdelay=00:00:00, mailer=dovecot, pri=120772, relay=dovecot, dsn=5.1.1, stat=User unknown
Sep 24 19:08:20 sogo sendmail[1581]: u8OH8IGB001579: u8OH8KGB001581: DSN: User unknown
Sep 24 19:08:20 sogo sendmail[1581]: u8OH8KGB001581: to= <[email protected]>, delay=00:00:00, xdelay=00:00:00, mailer=dovecot, pri=32017, relay=dovecot, dsn=5.1.1, stat=User unknown
Sep 24 19:08:21 sogo sendmail[1581]: u8OH8KGB001581: u8OH8KGC001581: return to sender: User unknown
Sep 24 19:08:23 sogo sendmail[1581]: u8OH8KGC001581: [email protected], delay=00:00:02, xdelay=00:00:02, mailer=relay, pri=33041, relay=mail.mail.com. [x.x.x.x], dsn=2.0.0, stat=Sent (u8OH8MqY017480 Message accepted for delivery)
Sep 24 19:10:23 sogo sendmail[1604]: u8OHAMNp001604: <[email protected]>... User unknown
Sep 24 19:10:23 sogo sendmail[1604]: u8OHAMNp001604: from= <[email protected]>, size=0, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
答案1
好的,所以我的两个问题都在 /etc/mail/virtusertable 中,我在那里有一个不应该存在的销售条目
[email protected] sales
那么对于信息我应该有一个条目,因为 AD 中的用户名与电子邮件地址不同
[email protected] [email protected]
问题解决了,开心的日子!