当用户在Debian 9服务器上进行身份验证时,我想发送邮件。我使用OVH邮件服务器。我已经建立了这样的msmtp:
account myaccount
tls_starttls off
logfile ~/.msmtp.log
host ssl0.ovh.net
port 465
from user@mydomain.com
auth on
user user@mydomain.com
password XXXXXXXXXXXXXXXX
account default : myaccount我试图用以下方式发送邮件:
echo "Hello this is sending email using msmtp" | msmtp otheruser@mydomain.com但没起作用什么都没发生。命令也是如此:
msmtp --serverinfo --tls --tls-certcheck=off --host ssl0.ovh.net --port 465编辑1
我尝试了@Anfi在评论中提出的命令,我得到了:
-bash: subject:: command not found
ignoring system configuration file /etc/msmtprc: No such file or directory
loaded user configuration file /home/myuser/.msmtprc
falling back to default account
using account default from /home/myuser/.msmtprc
host = ssl0.ovh.net
port = 465
proxy host = (not set)
proxy port = 0
timeout = off
protocol = smtp
domain = localhost
auth = choose
user = user@mydomain.com
password = *
passwordeval = (not set)
ntlmdomain = (not set)
tls = off
tls_starttls = off
tls_trust_file = (not set)
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 = user@mydomain.com
add_missing_from_header = on
add_missing_date_header = on
remove_bcc_headers = on
dsn_notify = (not set)
dsn_return = (not set)
logfile = /home/myuser/.msmtp.log
syslog = (not set)
aliases = (not set)
reading recipients from the command line
msmtp: the server sent an empty reply
msmtp: could not send mail (account default from /home/myuser/.msmtprc)发布于 2019-11-07 11:29:51
好吧,我知道了。我需要将它添加到conf文件中:
tls on
tls_certcheck off邮件正常,但我得到了
<-- 250-AUTH LOGIN PLAIN不确定这是否真的安全
发布于 2022-03-27 09:53:17
问题在tls_starttls中。
您必须禁用证书文件并设置
account MyAccount
tls on
tls_certcheck off
tls_starttls off
host ssl0.ovh.net
port 465
from user@domain
user user@domain
password UserPassword
# Set a default account
account default : MyAccounthttps://serverfault.com/questions/990944
复制相似问题