Mutt 错误 SMTP 会话失败:读取错误

Mutt 错误 SMTP 会话失败:读取错误
set ssl_starttls=yes
set ssl_force_tls=yes

set imap_user = '[email protected]'
set imap_pass = 'password'

set from='[email protected]'
set realname='[email protected]'

set folder = imaps://imap.gmail.com/
set spoolfile = imaps://imap.gmail.com/INBOX
set postponed="imaps://imap.gmail.com/[Gmail]/Drafts"

set header_cache = "~/.mutt/cache/headers"
set message_cachedir = "~/.mutt/cache/bodies"
set certificate_file = "~/.mutt/certificates"

set smtp_url = 'smtp://[email protected]:[email protected]:465/'

set move = no
set imap_keepalive = 900

set smtp_pass="secrets"

发送邮件时出现该错误。服务器上的防火墙也关闭,安全组上的端口 465 打开。是否需要用mutt安装postfix?

Connection to smtp.gmail.com closed SMTP session failed: read error Could not send the message.

我可以阅读收件箱中的邮件,但无法发送电子邮件。这是我的邮件日志,

Mar  1 10:20:01 appsvr2 postfix/qmgr[6075]: 9703F3F7974: from=<[email protected]>, size=768, nrcpt=1 (queue active)
Mar  1 10:20:01 appsvr2 postfix/local[5970]: 9427E3F796E: to=<[email protected]>, orig_to=<root>, relay=local, delay=0.04, delays=0.03/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Mar  1 10:20:01 appsvr2 postfix/qmgr[6075]: 9427E3F796E: removed
Mar  1 10:20:01 appsvr2 postfix/local[5970]: 9703F3F7974: to=<[email protected]>, orig_to=<root>, relay=local, delay=0.04, delays=0.03/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Mar  1 10:20:01 appsvr2 postfix/qmgr[6075]: 9703F3F7974: removed
Mar  1 10:30:01 appsvr2 postfix/pickup[5945]: A43FB3E643: uid=0 from=<root>
Mar  1 10:30:01 appsvr2 postfix/cleanup[5980]: A43FB3E643: message-id=<[email protected]>
Mar  1 10:30:01 appsvr2 postfix/qmgr[6075]: A43FB3E643: from=<[email protected]>, size=827, nrcpt=1 (queue active)
Mar  1 10:30:01 appsvr2 postfix/local[5983]: A43FB3E643: to=<[email protected]>, orig_to=<root>, relay=local, delay=0.04, delays=0.03/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Mar  1 10:30:01 appsvr2 postfix/qmgr[6075]: A43FB3E643: removed

答案1

我将配置中的端口从 更改465587并能够发送电子邮件。配置中正确的行应该如下所示

set smtp_url = 'smtp://[email protected]:[email protected]:587/'

答案2

你必须修改你的smtp_url.注意smtp对应的是587端口,smtps对应的是465端口。

出于安全原因,首选端口 465。[email protected]在下面的行中更新您的电子邮件。

set smtp_url = "smtps://[email protected]@smtp.mail.com:465/"

或者

set smtp_url = "smtp://[email protected]@smtp.mail.com:587/"

相关内容