我在 Fedora 38 机器上安装了 Postfix,其中包含以下内容:
$ grep smtp_ main.cf
smtp_sasl_auth_enable = yes
smtp_sasl_type = cyrus
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_always_send_ehlo = yes
smtp_use_tls = yes
smtp_sasl_tls_security_options = noanonymous
smtp_tls_wrappermode = yes
smtp_tls_security_level = encrypt
$ grep smtpd_ main.cf
smtpd_banner = $myhostname ESMTP
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_client_restrictions = permit_mynetworks, permit
smtpd_recipient_restrictions = permit_mynetworks, permit_auth_destination, permit_sasl_authenticated, reject
# smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/pki/tls/certs/arixserver.crt
smtpd_tls_key_file = /etc/pki/tls/certs/arixserver.key
smtpd_tls_session_cache_database = btree:/etc/postfix/smtpd_scache
我试图像这样登录它,其中用户名/密码是用类似的东西生成的perl -MMIME::Base64 -e 'print encode_base64("myvalue")
$ telnet mail 25
Trying 107.133.6.164...
Connected to arix.com.
Escape character is '^]'.
220 mail.arix.com ESMTP
EHLO arix.com
250-mail.arix.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250 CHUNKING
AUTH LOGIN
334 VXNlcm5hbWU6
Z=======
334 UGFzc3dvcmQ6
Z===========YXNz
535 5.7.8 Error: authentication failed: UGFzc3dvcmQ6
我在这里阅读了很多帖子,据我了解,对服务器的身份验证是由 Dovecot 处理的(所以我猜测 smtpd_* 信息是相关的),并且我知道用户名/密码是正确的,因为我可以登录使用它们的主机(使用 SSH),以及:
$ testsaslauthd -u $USR -p $PASS
0: OK "Success..
为什么我会遇到身份验证失败的情况?
TIA——埃基斯
像这样生成 base64 值会更好:
并且 AUTH PLAIN 将起作用