Start with installing exim.
user@devmachine:~$ sudo apt-get install exim4
Configure exim to handle desired domains
Next step is to confiure exim to treat a number of domains as local.
user@devmachine:~$ sudo dpkg-reconfigure exim4-config
Use the answers below and modify to suite your own needs.
- General type of mail configuration
- local delivery only; not on a network
- System mail name<
- enter hostname example devmachine
- IP-addresses to listen on for incoming SMTP connections
- 127.0.0.1 ; ::1
- Other destinations for which mail is accepted
- devmachine; example.com; hotmail.com
- Keep number of DNS-queries minimal (Dial-on-Demand)?
- Delivery method for local mail
- mbox format in /var/mail/
- Split configuration into small files?
- Mail for ‘postmaster’, ‘root’ and other system accounts needs to be redirected to the user account of the actual system administrator.
- Leave empty we will take care of this below.
Configure catch all
So now we want to make sure all emails are routed to the same local user. Start by creating the file /etc/exim4/conf.d/router/950_exim4-config_catchall with this content.
Then add the following to /etc/aliases. Replace user with your local username.
Build new exim4 config and restart