Nullmailer
- Choose a local domain to be used
e.g. cave.local
- Add the local server to the desired smarthosts dns or hosts file:
e.g. server.cave.local
- Set the mailname of the local server to the same name (hostname can be whatever you want)
# /etc/mailname
server.cave.local
- Set the forward- or targetaddress for any mail
# /etc/nullmailer/adminaddr
somebody@germany.de
- Set the local default domain to the domain from step 1
# /etc/nullmailer/defaultdomain
cave.local
- Edit delivery target, user and password (connection can be secured by using the vpn or add –ssl and import the needed certificates)
# /etc/nullmailer/remotes
target.server.at.vpn smtp --user=name@cave.local --pass=<password> [--ssl [--insecure]]
- Stop nullmailer use testmail.sh and nullmailer-send to debug.
/sbin/testmail.sh
#! /bin/bash
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
cat <<EOF | sendmail root
Subject: Testmail
Server $(hostname -f)
DateTime $(date)
.
EOF