-1

root@sourav-HP-Pavilion-dv6500-Notebook-PC:/var/log# echo -e "Subject: Test Mail\r\n\r\n This is my first test email." | msmtp --debug --from=default -t souravsachdeva13@gmail.com

loaded system configuration file /etc/msmtprc

ignoring user configuration file /root/.msmtprc: No such file or directory

falling back to default account

using account default from /etc/msmtprc

host = smtp.gmail.com

port = 587

proxy host = (not set)

proxy port = 0

timeout = off

protocol = smtp

domain = localhost

auth = choose

user = souravsachdeva13@gmail.com

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 = default

add_missing_from_header = on

add_missing_date_header = on

remove_bcc_headers = on

dsn_notify = (not set)

dsn_return = (not set)

logfile = /var/log/msmtp.log

syslog = (not set)

aliases = (not set)

reading recipients from the command line and the mail

msmtp: cannot connect to smtp.gmail.com, port 587: Connection timed out

msmtp: could not send mail (account default from /etc/msmtprc)

root@sourav-HP-Pavilion-dv6500-Notebook-PC:/var/log#

I am trying different servers for past 3-4 hours and none of them seems to work fine for me.This one did showed some output which I think can be helpful to debug it. Do you see any setting missing or wrongly configured.

4

1 回答 1

0

您不需要获得应用程序密码吗?

我在 msmtprc 中写了 gmail 'password'。我在下面收到错误。

msmtp: authentication failed (method PLAIN)
msmtp: server message: 535-5.7.8 Username and Password not accepted. Learn more at
msmtp: server message: 535 5.7.8  https://support.google.com/mail/?p=BadCredentials k123-v6sm24743490pga.21 - gsmtp
msmtp: could not send mail (account gmail from /home/miwa/.msmtprc)

我设置了应用程序密码(访问错误消息中的 URI),然后我可以将邮件发送到 Gmail。

我使用 msmtp 版本。(在 ArchLinux 上)

% msmtp --version
msmtp version 1.6.8
Platform: x86_64-pc-linux-gnu
TLS/SSL library: GnuTLS
Authentication library: GNU SASL
Supported authentication methods:
plain scram-sha-1 external gssapi cram-md5 digest-md5 login 
IDN support: enabled
NLS: enabled, LOCALEDIR is /usr/share/locale
Keyring support: Gnome 
System configuration file name: /etc/msmtprc
User configuration file name: /home/miwa/.msmtprc

Copyright (C) 2018 Martin Lambers and others.
This is free software.  You may redistribute copies of it under the terms of
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.
There is NO WARRANTY, to the extent permitted by law.
于 2018-08-16T07:03:53.267 回答