Routing mail messages to your mailserver efficiently
Posted by Steve on Wed 10 May 2006 at 11:27
If you control satellite systems which need to relay their mail through a centralized host for sending then you have several choices. Perhaps the simplest software to use is the nullmailer program.
In the past we've looked at setting up exim, postfix, and sendmail forwarding but if you're not expecting to send much mail, and you don't need much processing then running a full mailserver is probably overkill.
The nullmailer package is very simple to configure and install. You can install it via:
root@itchy:~# apt-get install nullmailer Reading package lists... Done Building dependency tree... Done Recommended packages: sysklogd system-log-daemon The following packages will be REMOVED: exim4 exim4-base exim4-config exim4-daemon-light The following NEW packages will be installed: nullmailer 0 upgraded, 1 newly installed, 4 to remove and 26 not upgraded. Need to get 81.2kB of archives. After unpacking 3019kB disk space will be freed. Do you want to continue [Y/n]?
As you can see installing a the nullmailer will remove the current mailserver you have installed, whether that is exim4 (the default mailer for Debian), postfix, or sendmail. Notice that the packages will only be removed and not purged. This means that your old configuration files will remain.
Once nullmailer is installed you will be prompted to configure it. There are only two things to do:
- Specify your hostname, which will be used as the sender domain.
- Specify your "smarthost" - which is the machine mail(s) should be forwarded to.
These can be adjusted later by editing the files /etc/mailname and /etc/nullmailer/remotes respectively.
Once configured and started you can proceed to remove the old configuration settings if you're happy:
root@itchy:~# dpkg --purge exim4 exim4-base exim4-config exim4-daemon-light dpkg - warning: ignoring request to remove exim4 which isn't installed. (Reading database ... 73209 files and directories currently installed.) Removing exim4-base ... Purging configuration files for exim4-base ... Removing exim4-config ... Purging configuration files for exim4-config ... No override present. dpkg - warning: ignoring request to remove exim4-daemon-light which isn't installed.
Messages which are delivered will be logged to syslog, (being visible in /var/log/mail.* by default), and you can see any queued but undelivered mails via the mailq program as you would expect.