为什么我无法发送邮件?

为什么我无法发送邮件?

我安装了 iredmail,并用它在基于 Debian 7 的 VPS 上设置了邮件服务器。一切顺利,我可以通过网络邮件发送和接收电子邮件。然而,当我尝试在客户端程序(The Bat Professional,Windows 7)上通过 SMTP 发送邮件时,我收到一条错误消息“发件人地址被拒绝:未登录”。

我正在尝试找出此问题的原因。这是手动 telnet 并尝试发送邮件的结果。我在电子邮件客户端程序所在的同一台计算机上通过 Windows 上的 telnet 进行了此测试,并且还通过远程 debian 服务器上的 telnet 进行了检查。两次都通过 telnet 成功发送了电子邮件。

#telnet apollo.who.org 25
Trying 17.24.33.171...
Connected to apollo.who.org.
Escape character is '^]'.
220 apollo.who.org ESMTP Postfix (Debian/GNU)
HELO apollo.who.org
250 apollo.who.org
auth login
334 VXNlcm5hbWU6
am9lbEBkcmpvZWwuaW5mbw==
334 UGFzc3dvcmQ6
UTI3cG0zNU4yYg==
235 2.7.0 Authentication successful
MAIL FROM:<[email protected]>
250 2.1.0 Ok
RCPT TO:<[email protected]>
250 2.1.5 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
Subject:Test

Check success.
.
250 2.0.0 Ok: queued as 5E150C2FF2

通过 telnet 上的 smtp 手动发送电子邮件成功了。电子邮件已送达。所以这似乎是客户端程序配置方面的问题?

客户端程序的日志显示:

 12/06/2013, 13:22:42: IMAP  - Connecting to IMAP server apollo.who.org on port 993
 12/06/2013, 13:22:44: IMAP  - Initiating TLS handshake
>12/06/2013, 13:22:45: IMAP  - Certificate S/N: B25F55E1155DD8A8, algorithm: RSA (2048 bits), issued from 6/11/2013 5:26:55 PM to 6/9/2023 5:26:55 PM, for 1 host(s): apollo.who.org.
>12/06/2013, 13:22:45: IMAP  - Owner: CN, GuangDong, ShenZhen, apollo.who.org, IT, apollo.who.org, [email protected].
>12/06/2013, 13:22:45: IMAP  - This certificate is self-issued.
 12/06/2013, 13:22:45: IMAP  - TLS handshake complete
 12/06/2013, 13:22:45: IMAP  - Connected to IMAP server (apollo.who.org)
>12/06/2013, 13:22:45: IMAP  - Dovecot ready.
 12/06/2013, 13:22:46: IMAP  - Authenticating (user: "[email protected]", method: "LOGIN")...
 12/06/2013, 13:22:47: IMAP  - IMAP server authentication OK, server says "Logged in"
 12/06/2013, 13:23:21: SEND  - sending mail message(s) - 1 message(s) in queue
 12/06/2013, 13:23:21: SEND  - Connecting to SMTP server apollo.who.org on port 25
 12/06/2013, 13:23:21: SEND  - connected to SMTP server
 12/06/2013, 13:23:23: SEND  - WARNING: there were no compatible authentication mechanisms detected
 12/06/2013, 13:23:23: SEND  - sending message to [email protected]
 12/06/2013, 13:23:23: SEND  - The last address submitted was <[email protected]>
!12/06/2013, 13:23:23: SEND  - Message has not been sent. Server reply - 5.7.1 <[email protected]>: Sender address rejected: not logged in
 12/06/2013, 13:23:24: SEND  - connection finished - 0 message(s) sent
 12/06/2013, 13:23:24: SEND  - Some messages were not sent - check the log for details

我应该使用什么设置来配置客户端程序以通过该服务器发送电子邮件?

目前,我已经尝试过:

  1. 常规。日志如上
  2. 开始TTLS。
  3. TLS

SMTP 身份验证已设置为开启。安全身份验证已启用。

检查了端口 25、993 和 995。

Netstat 结果:

 #netstat -lpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:4190            0.0.0.0:*               LISTEN      2537/dovecot
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      2537/dovecot
tcp        0      0 127.0.0.1:7777          0.0.0.0:*               LISTEN      1674/python
tcp        0      0 0.0.0.0:995             0.0.0.0:*               LISTEN      2537/dovecot
tcp        0      0 127.0.0.1:10024         0.0.0.0:*               LISTEN      1439/amavisd-new (m
tcp        0      0 127.0.0.1:10025         0.0.0.0:*               LISTEN      3509/master
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      2359/mysqld
tcp        0      0 0.0.0.0:587             0.0.0.0:*               LISTEN      3509/master
tcp        0      0 0.0.0.0:110             0.0.0.0:*               LISTEN      2537/dovecot
tcp        0      0 127.0.0.1:9998          0.0.0.0:*               LISTEN      1439/amavisd-new (m
tcp        0      0 127.0.0.1:10031         0.0.0.0:*               LISTEN      2574/perl
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      2537/dovecot
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1459/apache2
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1585/sshd
tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      3509/master
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      1459/apache2
tcp6       0      0 :::22                   :::*                    LISTEN      1585/sshd

答案1

关键在于

 12/06/2013, 13:23:23: SEND  - WARNING: there were no compatible authentication mechanisms detected

我们发现,这意味着服务器不支持客户端配置要求使用的任何身份验证方法。当您重新配置客户端以不需要服务器不支持的任何身份验证方法时,它就可以正常工作。

我把这个写成答案,部分是为了让您可以接受它,从而将问题搁置,但部分是警告您该服务器似乎正在运行开放的 SMTP 中继:我们已经确认至少有两个独立的主机可以使用它来中继邮件而无需任何类型的身份验证。

如果它位于防火墙后面,或者它实际上只允许从您控制的地址列表进行中继(并且两个外部测试点都位于该地址列表上),那么一切都很好。否则,您确实需要非常快速地确定该中继,否则您将向互联网发送大量垃圾邮件,并且就 RBL 而言,您作为发送服务器的声誉将一落千丈。

相关内容