POSTFIX 身份验证无法登录

POSTFIX 身份验证无法登录

我尝试使用 sasl auth 设置我的 postfix smtp。当我在本地服务器上使用 telnet 检查时,它似乎可以正常工作。

输出:

# telnet mail.domain.tld smtp
Trying 37.34.52.199...
Connected to mail.domain.tld.
Escape character is '^]'.
220 mail.domain.tld ESMTP Postfix
ehlo domain.tld
250-mail.domain.tld
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

但是当我尝试测试登录身份验证时,我被困在用户名中:

auth login
334 VXNlcm5hbWU6
dXNlcm5hbWUK
535 5.7.8 Error: authentication failed: VXNlcm5hbWU6

创建的用户名如下:

 # echo 'username' | base64

我确信该用户存在,我也使用同一个用户登录了 IMAP。

postconf 输出:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = domain.tld
myhostname = mail.domain.tld
mynetworks = 127.0.0.0/8
mynetworks_style = host
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
unknown_local_recipient_reject_code = 550

谢谢你!

答案1

我建议使用 swaks 来测试 postfix。

swaks -s mail.domain.tld --to [email protected] --from [email protected] --auth LOGIN --auth-user [email protected]

相关内容