I am trying to setup Ubuntu 20.04 with msmtp as a system configuration.
I installed msmtp (v1.8.6-1) and heirloom-mailx (v12.5-2+deb7u1build0.14.04.1).
Config file /etc/msmtprc (chmod: 600) has the following:
# Set default values for all accounts.
account default
auth on
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile /var/log/msmtp
# gmail
host smtp.gmail.com
port 587
from <account>@gmail.com
user <account>
password <password>
# Syslog logging with facility LOG_MAIL instead of the default LOG_USER
syslog LOG_MAIL
Log file /var/log/msmtp file mode is 660.
File /etc/mailrc (chmod: 600) contains the following:
set sendmail="/usr/bin/msmtp"
When I try to use sendmail to send an email from terminal I get the following sendmail: account default not found: no configuration file available.
The same error comes up if I directly invoke msmtp.
Warning : My advise is based on Debian
msmtp
package.Recommended Fix: Make
/etc/msmtprc
owned by groupmsmtp
.Explanation:
msmtp
binary is installed as set group (msmtp
) id