具有 SASL 和 Dovecot 2 配置的 Postfix

具有 SASL 和 Dovecot 2 配置的 Postfix

我正在嘗試配置我的伺服器來接收和發送郵件。發送郵件沒有問題,但是接收郵件似乎有問題。我的舊伺服器上有此配置,但現在我正在遷移到安裝了 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.

相關內容