First, install the appropriate packages:
sudo apt-get install mailutils
Configure Exim for external mail:
sudo dpkg-reconfigure exim4-config
Options:
- mail sent by smarthost; no local mail
- FQDN of the system
- 127.0.0.1 (This will prevent external use of the server to send mail.)
- localhost; hostname
- FQDN of the system
- External (ISP) SMTP server
- Dial-on-Demand? No
- Split config? No
- Root/postmaster recipient: (enter the email address you wish to receive messages sent to root/postmaster on the system).
The root/postmaster recipient is stored in /etc/aliases
The Exim configuration is stored in /etc/exim4/update-exim4.conf.conf. To apply configuration manually changed in this file, run:
sudo update-exim4.conf sudo /etc/init.d/exim4 restart
Actual Exim configuration is stored in /var/lib/exim4/config.autogenerated. Don’t edit this file directly.
This was tested on Ubuntu 10.04 (Lucid)