我正在尝试配置我的服务器以接收和发送邮件。发送邮件没有问题,但接收邮件似乎有问题。我的旧服务器上有此配置,但现在我正在迁移到安装了 Dovecot 2 的新服务器,配置似乎失败了。我在 /var/log/syslog 中不断收到以下错误日志:
May 25 12:51:18 server postfix/smtpd[17208]: connect from localhost[::1]
May 25 12:51:18 server postfix/smtpd[17208]: warning: SASL: Connect to smtpd failed: No such file or directory
May 25 12:51:18 server postfix/smtpd[17208]: fatal: no SASL authentication mechanisms
May 25 12:51:19 server postfix/master[17011]: warning: process /usr/lib/postfix/smtpd pid 17208 exit status 1
May 25 12:51:19 server postfix/master[17011]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling
dovecot -n 的输出:
# 2.1.7: /etc/dovecot/dovecot.conf
# OS: Linux 3.2.0-4-amd64 x86_64 Debian 7.8 ext4
auth_mechanisms = plain login
base_dir = /var/run/dovecot/
first_valid_uid = 150
last_valid_uid = 150
mail_access_groups = mail
mail_gid = 150
mail_location = maildir:/var/vmail/%d/%n
mail_uid = 150
namespace inbox {
inbox = yes
location =
mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
mailbox Sent {
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox Trash {
special_use = \Trash
}
prefix =
}
passdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
protocols = imap
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
}
unix_listener auth-master {
group = mail
mode = 0660
user = vmail
}
}
service imap-login {
executable = /usr/lib/dovecot/imap-login
inet_listener imap {
port = 0
}
inet_listener imaps {
address = *
port = 993
}
}
service imap {
executable = /usr/lib/dovecot/imap
}
ssl_cert = </etc/ssl/eyeducate.com/eyeducate-com.crt
ssl_key = </etc/ssl/eyeducate.com/eyeducate-com.key
userdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
protocol lda {
auth_socket_path = /var/run/dovecot/auth-master
postmaster_address = [email protected]
sendmail_path = /usr/sbin/sendmail
}
protocol imap {
imap_max_line_length = 64 k
}
postconf -n 的输出:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
dovecot_destination_recipient_limit = 1
inet_interfaces = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
milter_default_action = accept
milter_protocol = 2
mydestination = localhost, localhost.localdomain
myhostname = hera.eyeducate.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = eyeducate.com
non_smtpd_milters = $smtpd_milters
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:/var/lib/postfix/smtp_tls_session_cache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_data_restrictions = reject_unauth_pipelining, reject_multi_recipient_bounce, permit
smtpd_milters = inet:localhost:8891
smtpd_recipient_restrictions = permit_mynetworks, permit_tls_all_clientcerts, permit_sasl_authenticated, reject_non_fqdn_hostname, reject_non_fqdn_sender, reject_non_fqdn_recipient, reject_unauth_destination, reject_unauth_pipelining, reject_invalid_hostname, reject_rbl_client zen.spamhaus.org, reject_rbl_client bl.spamcop.net, reject_rbl_client cbl.abuseat.org, reject_rbl_client dnsbl.njabl.org, reject_rbl_client dnsbl.sorbs.net, reject_rhsbl_sender dsn.rfc-ignorant.org, check_policy_service inet:127.0.0.1:60000, permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_exceptions_networks = $mynetworks
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = smtpd
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_cert_file = /etc/ssl/eyeducate.com/eyeducate-com.crt
smtpd_tls_key_file = /etc/ssl/eyeducate.com/eyeducate-com.key
smtpd_tls_loglevel = 0
smtpd_tls_received_header = no
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:/var/lib/postfix/smtpd_tls_session_cache
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
virtual_alias_maps = proxy:mysql:$config_directory/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:8
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:mysql:$config_directory/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = proxy:mysql:$config_directory/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 150
virtual_transport = dovecot
virtual_uid_maps = static:150
这与升级到 Dovecot 2 有什么关系吗(我更新了配置文件)。Postfix 内置了对 dovecot 的支持,但我不确定是否必须针对版本 2 进行不同的编译?
答案1
Dovecot 配置为监听以下身份验证请求private/auth
:
unix_listener /var/spool/postfix/private/auth
但是,您告诉 Postfix 连接到一个完全不同的位置:
smtpd_sasl_path = smtpd
– 事实上,你(几乎)告诉它将身份验证请求发送到它自己的 SMTP 守护进程,它根本无法理解它们,更不用说将它们转发给 Dovecot 了。
将 Postfix 中的 SASL 套接字路径更改为private/auth
。