Msmtp Setup

Requirements

assuming submissions (implicit ssl)

nmap -p 465 md.angrycow.ru

Install

debian

apt install msmtp
# msmtp-mta

slackware

ls -lF /var/log/packages/ | grep postfix # emtpy
ls -lF /var/log/packages/ | grep dma # emtpy

slackpkg install pkg-config
slackpkg install gnutls
slackpkg install libsecret
slackpkg install p11-kit
slackpkg install nettle

sbopkg -r
sbopkg -i libgsasl
sbopkg -i msmtp
ldd /usr/bin/msmtp

ls -lhF /etc/ssl/certs/ca-certificates.crt
ls -lhF /etc/ssl/cacert.pem

alpine linux

apk add msmtp

sabotage linux

butch install msmtp

netbsd

pkg_add msmtp
cp -pi /etc/mailer.conf /etc/mailer.conf.dist
vi /etc/mailer.conf

from source

./configure --sysconfdir=/etc --localstatedir=/var --disable-nls  --with-tls=openssl

Some kind of a mail wrapper

gnu/linux

make the null-mailer available to the system

ls -lF /usr/bin/msmtp
ls -lF /usr/sbin/sendmail
ln -sf ../bin/msmtp /usr/sbin/sendmail

netbsd

sendmail        /usr/pkg/bin/msmtp
mailq           /usr/pkg/bin/msmtp
newaliases      /sbin/nologin

Setup

debian

cp -i /usr/share/doc/msmtp/examples/msmtprc-system.example /etc/msmtprc.dist

slackware

cp -i /usr/doc/msmtp-*/msmtprc-system.example /etc/msmtprc.dist

sabotage linux

cp -i /src/build/msmtp/msmtp-1.8.0/doc/msmtprc-system.example /etc/msmtprc.dist

netbsd

mv /usr/pkg/etc/msmtprc /etc/msmtprc.dist
touch /usr/pkg/etc/msmtprc
ln -s /usr/pkg/etc/msmtprc /etc/msmtprc

shared

grep -vE '^#|^$' /etc/msmtprc.dist > /etc/msmtprc.clean
grep -vE '^#|^$' /etc/msmtprc.dist > /etc/msmtprc
vi /etc/msmtprc

account default
host xc.nethence.com
port 465
tls on
tls_starttls off
tls_certcheck on
#tls_trust_file /etc/ssl/certs/ca-certificates.crt
tls_trust_file /etc/ssl/cacert.pem

auto_from on
maildomain DOMAIN-HERE

auth on
user USERNAME-HERE
password PASSWORD-HERE

syslog LOG_MAIL

Acceptance

see null-mailers

Troubleshooting

    sendmail: support for TLS is not compiled in

==> gnutls

Resources

MSMTP https://marlam.de/msmtp/


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5 | CONTACT
Copyright © 2024 Pierre-Philipp Braun