大网数据广告活动
服务器运维问答

msmtp and OVH mail

· 52CE 我爱测

I'd like to send a mail when a user authenticates on a Debian 9 server. I use OVH mail server. I've set up msmtp like so : account myaccount tls_starttls off logfile ~/.msmtp.log host ssl0.ovh.net port 465 from [email omitted] au…

问题原文

原帖链接 · Ror · CC BY-SA 4.0

I'd like to send a mail when a user authenticates on a Debian 9 server. I use OVH mail server. I've set up msmtp like so :

account myaccount
tls_starttls off
logfile ~/.msmtp.log

host ssl0.ovh.net
port 465
from [email omitted]
auth on
user [email omitted]
password XXXXXXXXXXXXXXXX

account default : myaccount

I tried to send a mail with :

echo "Hello this is sending email using msmtp" | msmtp [email omitted]

But didn't work, nothing happens. Same for the command :

msmtp --serverinfo --tls --tls-certcheck=off --host ssl0.ovh.net --port 465

EDIT 1

I tried the command proposed by @Anfi in the comments and I get :

-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 = [email omitted]
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 = [email omitted]
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)

已采纳解答

原帖链接 · Ror · CC BY-SA 4.0

All right, I got it. I needed to add this to the conf file:

tls on
tls_certcheck off

The mail works, but I get

<-- 250-AUTH LOGIN PLAIN

Not sure if this is really secure then

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-11-07)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。