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.
[ Parent | Reply to this comment ]
Note that the version of nullmailer distributed in Debian stable doesn't support SMTP AUTH, although the version in testing/unstable should.
Also, it doesn't support STARTTLS, which might make it unsuitable for trans-internet delivery. Some alternatives are listed on http://wiki.mutt.org/?LightSMTPagents.
[ Parent | Reply to this comment ]
Once I added that package, everything worked.
--
Roberto C. Sanchez
http://familiasanchez.net/~roberto
[ Parent | Reply to this comment ]
it support also authentification. This is usefull to "forward" local home mail (dynamic IP) to an external MTA (not my ISP).
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | View Weblogs ]
If you want local mail then you're not an appropriate user for nullmailer - it is designed for setups where you have a lot of machines all relaying mail centrally; for example a hosting company.
[ Parent | Reply to this comment ]
lets say I have one box running sarge where all my email will be handled.
on my desktops I can then install nullmailer and follow your guide and it will send my mails to the server I specify. The problem was when I upgraded from woody on my server, exim (3 I think) was installed, with one relaively simple config file. Upgrading brought exim4 And foolishly perhaps I allowed it to split my configuration into what appears now to be lots of files :-)
So I would love to be able to send (and of course recieve) email from any host on my lan with only my server doing the actual talking to my isp. So it looks like nullmailer is for me but I am would need to find out what needs to be done on the server side.
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]