Setting up the best null client ever! (DMA)

outbound email the easy way

Introduction

We’ve tried a few:

The clear winner is DMA as it is able to deliver messages locally, it has its own queue and it’s not only implicit SSL but also STARTTLS capable. Besides, we didn’t even have to change anything to the default configuration, which is appreciated, as it simplifies system’s post-installation.

System preparation

The good thing with DMA is that it reads a plain-text aliases files without the need to run newaliases, hence no need for another MTA package containing that command line.

ls -lhF /etc/aliases #noexist
ls -ldhF /etc/mail/ #noexist
ls -ldhF /etc/postfix/ #noexist
vi /etc/aliases #newfile

root:           SOME-TRUE-EMAIL
MAILER-DAEMON:  postmaster
postmaster:     root
bin:            root
daemon:         root
games:          root
ingres:         root
nobody:         root
system:         root
toor:           root
uucp:           root
manager:        root
dumper:         root
webmaster:      root
abuse:          root
decode:         root

It’s also good to know which host is actually talking to you daily

    vipw

    root:x:0:0:root@HOST:/root:/bin/bash

DMA install

Slackware

sbopkg -i dma

from source

git clone https://github.com/corecode/dma.git
cd dma/
make
make install sendmail-link mailq-link install-spool-dirs install-etc
ls -lhF /usr/local/sbin/sendmail

ls -lhF /usr/sbin/sendmail #noexist
#mv /usr/sbin/sendmail /usr/sbin/sendmail.dist
#chmod -x /usr/sbin/sendmail.dist
ln -s /usr/local/sbin/sendmail /usr/sbin/sendmail

DMA setup

Defaults are fine already, as long as you have an FQDN hostname.

Otherwise, define it there and eventually take the chance to enforce STARTTLS

mv -i /etc/dma/dma.conf /etc/dma/dma.conf.dist
grep -vE '^#|^$' /etc/dma/dma.conf.dist #emtpy
hostname --long
cat > /etc/dma/dma.conf <<EOF
MAILNAME `hostname --long`
SECURETRANSFER
STARTTLS
EOF
cat /etc/dma/dma.conf

Ready to go

On the Postfix relay, no need to add the host to $mydestination nor $mynetworks. Just setup an a SPF record and your hosts will be able to contact you.

To check and re-process the queue

mailq
sendmail -q

Acceptance

# it's s-nail now
slackpkg search s-nail

tail -F /var/log/maillog &
date | mailx -s `uname -n` root

Trash

nullmailer

tested on Ubuntu

define outbound relay

apt install nullmailer bsd-mailx alpine
#mailutils s-nail

vi /etc/nullmailer/remotes

slackmx.nethence.com smtp --starttls

msmtp

nogo with msmtp (I dont want tls, I want starttls)

slackpkg install msmtp gnutls libsecret p11-kit nettle
ls -lhF /etc/ssl/certs/ca-certificates.crt
cp -i /usr/doc/msmtp-1.6.5/msmtprc-system.example /etc/msmtprc.dist
vi /etc/msmtprc
...

mv /usr/sbin/sendmail /usr/sbin/sendmail.dist
chmod -x /usr/sbin/sendmail.dist
ln -s /usr/bin/msmtp /usr/sbin/sendmail

sendmail

nogo with sendmail (I dont want to start a daemon and listen on the network)

#now in extra/
slackpkg install sendmail

Resources

Just want to send emails from my Ubuntu Server. What simple SMTP server solution to use? [closed] https://superuser.com/questions/92760/just-want-to-send-emails-from-my-ubuntu-server-what-simple-smtp-server-solution

Using nullmailer with STARTTLS and SMTP-Auth https://metzlog.srcbox.net/2012/11/nullmailer-with-starttls/

How to enable secure authentication (ssl,tls,starttls) in nullmailer 1.0.5. and upgrade nullmailer to 1.11 https://unix.stackexchange.com/questions/252179/how-to-enable-secure-authentication-ssl-tls-starttls-in-nullmailer-1-0-5-and

Lightweight outgoing SMTP server https://unix.stackexchange.com/questions/1449/lightweight-outgoing-smtp-server

runq

Linux Network Administrator’s Guide, 2nd Edition https://www.oreilly.com/openbook/linag2/book/ch18.html

the challengers

Nullmailer https://wiki.archlinux.org/index.php/Nullmailer

MSMTP https://marlam.de/msmtp/

SSMTP https://packages.qa.debian.org/s/ssmtp.html https://wiki.archlinux.org/index.php/SSMTP

DMA https://github.com/corecode/dma https://www.dragonflybsd.org/handbook/mta/ https://www.dragonflybsd.org/docs/howtos/HowTo_dma_gmail/ https://wiki.debian.org/Debate/DefaultMTA/DMA https://wiki.debian.org/Debate/DefaultMTA#dma

Minimal-Mailer https://www.heise.de/select/ct/2018/12/1528000378377701


HOME | GUIDES | BENCHMARKS | html