msmtp TLS超时

时间:2019-06-06 01:06:36

标签: gmail-imap msmtp

我已经仔细研究了可能的解决方案列表,但我没有看到这个问题。

我在crontab条目中使用smtp多年了,以通过电子邮件提供状态更新。然后它在本周退出了,我无法修复它。然后我看到它已经变成孤立的了,建议是转移到msmtp。因此,我将其下载并安装在Ubuntu 18.10系统上。

我正在尝试将电子邮件发送到myaccount@gmail.com帐户。 看来我正在与gmail smtp服务器正确通信,如下面的调试所示。但是它总是会得到一个TLS超时。

我也不明白为什么我有多个EHLO条目。我的系统没有DNS域名,所以我不确定在这里输入什么。本地主机似乎工作正常。另外,我的Thunderbird电子邮件收发器可以正常使用gmail。

Here's the debug output:

echo "Hello there" | msmtp --debug myaccount@gmail.com >/tmp/msmtpOut.txt

ignoring system configuration file /etc/msmtprc: No such file or directory
loaded user configuration file /home/myhome/.msmtprc
falling back to default account
using account default from /home/myhome/.msmtprc
host = smtp.gmail.com
port = 587
proxy host = (not set)
proxy port = 0
timeout = off
protocol = smtp
domain = localhost
auth = choose
user = myaccount
password = *
passwordeval = (not set)
ntlmdomain = (not set)
tls = on
tls_starttls = on
tls_trust_file = /etc/ssl/certs/ca-certificates.crt
tls_crl_file = (not set)
tls_fingerprint = (not set)
tls_key_file = (not set)
tls_cert_file = (not set)
tls_certcheck = on
tls_min_dh_prime_bits = (not set)
tls_priorities = (not set)
auto_from = off
maildomain = (not set)
from = myaccount@gmail.com
add_missing_from_header = on
dsn_notify = (not set)
dsn_return = (not set)
logfile = (not set)
syslog = (not set)
aliases = (not set)
reading recipients from the command line
<-- 220 smtp.gmail.com ESMTP 4sm116524ywc.22 - gsmtp
--> EHLO localhost
<-- 250-smtp.gmail.com at your service, [71.56.87.81]
<-- 250-SIZE 35882577
<-- 250-8BITMIME
<-- 250-STARTTLS
<-- 250-ENHANCEDSTATUSCODES
<-- 250-PIPELINING
<-- 250-CHUNKING
<-- 250 SMTPUTF8
--> STARTTLS
<-- 220 2.0.0 Ready to start TLS
TLS certificate information:
    Owner:
        Common Name: smtp.gmail.com
        Organization: Google LLC
        Locality: Mountain View
        State or Province: California
        Country: US
    Issuer:
        Common Name: Google Internet Authority G3
        Organization: Google Trust Services
        Country: US
    Validity:
        Activation time: Tue 21 May 2019 04:48:45 PM EDT
        Expiration time: Tue 13 Aug 2019 04:32:00 PM EDT
    Fingerprints:
        SHA256: C7:78:B6:D6:4E:3E:2B:2F:08:6D:A4:84:E6:1D:87:8E:A1:DF:54:D2:AB:79:AC:A6:BB:50:E5:5D:EC:B4:20:4C
        SHA1 (deprecated): 39:C5:E5:40:64:37:17:25:17:7F:E8:BA:20:F4:70:F4:FE:22:70:22
--> EHLO localhost
msmtp: cannot read from TLS connection: the operation timed out
msmtp: could not send mail (account default from /home/myhome/.msmtprc)

1 个答案:

答案 0 :(得分:0)

使用--with-tls=openssl构建msmtp来解决问题。

关于EHLO命令发送了两次RFC3207状态:

  

服务器必须舍弃任何知识   从客户端获得的信息,例如EHLO命令的参数,   这不是从TLS协商本身获得的。客户端   必须丢弃从服务器获得的任何知识,例如列表   并非从TLS获得的SMTP服务扩展名   谈判本身。客户端应该发送EHLO命令作为   TLS协商成功后的第一个命令。

这是正常的行为。