1. Choose a local domain to be used
    e.g. cave.local

  2. Add the local server to the desired smarthosts dns or hosts file:
    e.g. server.cave.local

  3. Set the mailname of the local server to the same name (hostname can be whatever you want)
    # /etc/mailname
  4. Set the forward- or targetaddress for any mail
    # /etc/nullmailer/adminaddr
  5. Set the local default domain to the domain from step 1
    # /etc/nullmailer/defaultdomain
  6. 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 smtp --user=name@cave.local --pass=<password> [--ssl [--insecure]]
  7. Stop nullmailer use and nullmailer-send to debug.


#! /bin/bash

cat <<EOF | sendmail root
Subject: Testmail

Server $(hostname -f)
DateTime $(date)