我在 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——埃基斯
答案1
像这样生成 base64 值更好:
$ echo -ne '\000user\000password' |openssl base64
并且 AUTH PLAIN 将会起作用