Aufbau

Aufbau

Ich habe versucht, E-Mails mit msmtp zu senden, ohne Erfolg

Konfigurationsdatei: ~/.msmtprc

defaults
auth           on
tls            on
tls_trust_file /etc/ssl/certs/ca-bundle.crt
logfile        ~/.msmtp.log

account iisr
host smtp.yandex.com
port 465
user [email protected]
from [email protected]
password ********

beim Testen mit dem Befehl , keine Ergebnisse, weder in der Protokolldatei,echo "hello there username." | msmtp -a iisr [email protected]

mithilfe des Skripts von @Andrezj in der Antwort weiter unten erhalte ich die folgende Ausgabe und sie bleibt so:

ignoring system configuration file /etc/msmtprc: No such file or directory
loaded user configuration file /home/bakenoor/.msmtprc
using account iisr from /home/bakenoor/.msmtprc
host                  = smtp.yandex.com
port                  = 465
timeout               = off
protocol              = smtp
domain                = localhost
auth                  = choose
user                  = [email protected]
password              = *
passwordeval          = (not set)
ntlmdomain            = (not set)
tls                   = on
tls_starttls          = on
tls_trust_file        = /etc/ssl/certs/ca-bundle.crt
tls_crl_file          = (not set)
tls_fingerprint       = (not set)
tls_key_file          = (not set)
tls_cert_file         = (not set)
tls_certcheck         = on
tls_force_sslv3       = off
tls_min_dh_prime_bits = (not set)
tls_priorities        = (not set)
auto_from             = off
maildomain            = (not set)
from                  = [email protected]
dsn_notify            = (not set)
dsn_return            = (not set)
keepbcc               = off
logfile               = /home/bakenoor/.msmtp.log
syslog                = (not set)
aliases               = (not set)
reading recipients from the command line and the mail

Irgendeine Idee, warum die E-Mail nicht gesendet wird?

Antwort1

Aufbau

Stellen Sie für SMTP-Port 465 sicher, dass die Option TLS starten aktiviert ist.ausin der $HOME/.msmtprcDatei:

defaults
auth           on
tls            on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile        /tmp/msmtp.log

account        ACCOUNT
host           mail.host.com
port           465
from           [email protected]
user           [email protected]
password       PASSWORD
tls_starttls   off

account default : ACCOUNT

Stellen Sie außerdem sicher, dass die Dateiberechtigungen auf den Benutzer beschränkt sind:

chmod 600 $HOME/.msmtprc

Debuggen des Sendens von MSMTP-E-Mails

Verwenden Sie das folgende Testskript, um ein vollständiges Transkript der SMTP-Sitzung zu erhalten

#!/bin/sh
# msmtp specific options
# -d : debug
# -a : account name
# sendmail compatibility options
# -i : ignored for sendmail capability
# -t : Read recipient addresses from the To, Cc, and Bcc headers 
msmtp -d -a iisr -i -t <<END
From: [email protected]
To: [email protected]
Subject: test

test
END

Verwandt

Ausführlichere Informationen finden Sie hier:

Antwort2

Unter CentOS 7.3 hinter einer Firewall, mein /etc/msmtprc:

defaults
logfile /var/log/msmtp.log
domain localhost
auth on
port 465
host smtp.gmail.com
tls on
tls_starttls off
auth on
tls_trust_file /etc/ssl/certs/ca-bundle.crt
# gmail account
account workflow
user *[email protected]*
from *[email protected]*
password *mypassword*
# set default account to use
account default : workflow

verwandte Informationen