我已經搜索過,但未能找到答案,我沒有想法。我只是對 postfix 和 dovecot 不夠了解,無法解析配置或了解可能導致此錯誤的原因。
warning: SASL: Connect to /var/spool/postfix/private/auth failed: No such file or directory
fatal: no SASL authentication mechanisms
我無法使用 SASL 連接外部客戶端(例如 Thunderbird)來進行 postfix。我希望這是顯而易見的事情,但我就是看不見它。
/var/spool/postfix/private/auth
存在。它屬於 postfix 所有。 Dovecot 設定為使用 postfix 為用戶Dovecot 正在運行並監聽:
unix 2 [ ACC ] STREAM LISTENING 241906 12768/dovecot /var/spool/postfix/private/auth
postconf -n
輸出:alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases append_dot_mydomain = no biff = no broken_sasl_auth_clients = yes compatibility_level = 2 inet_interfaces = all inet_protocols = all local_recipient_maps = $virtual_mailbox_maps local_transport = virtual mailbox_size_limit = 0 milter_default_action = accept milter_protocol = 2 mydestination = $myhostname, my-server.my-server.com, my-server, localhost.localdomain, localhost myhostname = my-server mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 myorigin = /etc/mailname non_smtpd_milters = inet:localhost:12301 readme_directory = no recipient_delimiter = + relay_domains = $mydestination, proxy:pgsql:/etc/postfix/pgsql/relay_domains.cf relayhost = smtp_sasl_auth_enable = yes smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) smtpd_milters = inet:localhost:12301 smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination smtpd_sasl_auth_enable = yes smtpd_sasl_authenticated_header = yes smtpd_sasl_path = /var/spool/postfix/private/auth smtpd_sasl_security_options = noanonymous smtpd_sasl_type = dovecot smtpd_tls_cert_file = /etc/letsencrypt/live/mail.my-server.com/fullchain.pem smtpd_tls_key_file = /etc/letsencrypt/live/mail.my-server.com/privkey.pem smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtpd_use_tls = yes virtual_alias_maps = proxy:pgsql:/etc/postfix/sql/psql_virtual_alias_maps.cf, proxy:pgsql:/etc/postfix/sql/psql_virtual_alias_domain_maps.cf, proxy:pgsql:/etc/postfix/sql/psql_virtual_alias_domain_catchall_maps.cf virtual_gid_maps = static:113 virtual_mailbox_base = /var/mail/vmail virtual_mailbox_domains = proxy:pgsql:/etc/postfix/sql/psql_virtual_domains_maps.cf virtual_mailbox_limit = 512000000 virtual_mailbox_maps = proxy:pgsql:/etc/postfix/sql/psql_virtual_mailbox_maps.cf, proxy:pgsql:/etc/postfix/sql/psql_virtual_alias_domain_mailbox_maps.cf virtual_minimum_uid = 113 virtual_transport = virtual virtual_uid_maps = static:113
dovecot -n
輸出:# 2.2.33.2 (d6601f4ec): /etc/dovecot/dovecot.conf # Pigeonhole version 0.4.21 (92477967) # OS: Linux 4.15.0-66-generic x86_64 Ubuntu 18.04.3 LTS ext4 auth_mechanisms = plain login first_valid_uid = 113 log_path = /var/log/dovecot.log login_greeting = My Mail Server mail_location = maildir:/var/mail/vmail/%u/ mail_max_userip_connections = 50 mail_plugins = " zlib" mail_privileged_group = mail 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 Spam { special_use = \Junk } mailbox Trash { special_use = \Trash } prefix = type = private } passdb { driver = pam } passdb { args = /etc/dovecot/dovecot-sql.conf driver = sql } plugin { zlib_save = gz zlib_save_level = 6 } protocols = imap pop3 service auth { group = postfix unix_listener /var/spool/postfix/private/auth { group = postfix mode = 0666 user = postfix } unix_listener auth-userdb { group = postfix mode = 0666 user = postfix } user = postfix } service imap-login { inet_listener imaps { port = 993 ssl = yes } } service imap { executable = imap } ssl_cert = </etc/letsencrypt/live/mail.my-server.com/fullchain.pem ssl_client_ca_dir = /etc/ssl/certs ssl_key = # hidden, use -P to show it userdb { driver = passwd } userdb { args = /etc/dovecot/dovecot-sql.conf driver = sql } protocol imap { mail_plugins = " zlib imap_zlib" }
答案1
在某些發行版中,例如 Debian,postfix 預設在 chroot 中運行。 Chroot 更改了明顯的根目錄,因此 postfix 不會像您一樣看到您的檔案系統。這就是為什麼/var/spool/postfix/private/auth
即使檔案存在並且屬於 postfix 所有,它也看不到的原因。
如果您想在沒有 chroot 的情況下運行 postfix,請編輯您的/etc/postfix/master.cf
文件以明確為每個相關項目設定 chroot 列n
(對我來說,這就是所有項目)。請注意,如果您使用隱式預設值,-
您可能仍然會獲得 chroot,這顯然是由於某些發行版維護者更改了編譯預設值。
/etc/後綴/大師.cf:
# =============================================================
# service type private unpriv chroot wakeup maxproc command
# (yes) (yes) (yes) (never) (100)
# =============================================================
smtp inet n - n - - smtpd
如果您喜歡 chroot 操作,請參閱為 chroot 準備 posfix 的文件:基本配置自述文件#chroot_setup