Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
Forwarding root emails: /etc/aliases file is being ignored
I set up an Ubuntu 16.04 droplet to host my client’s website (let’s call it clientwebsite.com). I also helped him set up G Suite email hosting for his new business email (let’s call it firstname.lastname@example.org). In his G Suite settings, we set up a catch all so that all emails to @clientwebsite.com addresses are forwarded to email@example.com.
The Ubuntu server uses exim4 to send emails. I thought I configured it to send all server-related emails to me (let’s call me firstname.lastname@example.org). I ran
sudo dpkg-reconfigure exim4-config which resulted in a
/etc/exim4/update-exim4.conf.conf file like this:
dc_eximconfig_configtype='internet' dc_other_hostnames='clientwebsite.clientwebsite.com; clientwebsite; localhost.localdomain; localhost' dc_local_interfaces='127.0.0.1' dc_readhost='' dc_relay_domains='' dc_minimaldns='false' dc_relay_nets='' dc_smarthost='' CFILEMODE='644' dc_use_split_config='false' dc_hide_mailname='' dc_mailname_in_oh='true' dc_localdelivery='mail_spool'
And I edited the
/etc/aliases file to look like this:
mailer-daemon: email@example.com postmaster: firstname.lastname@example.org nobody: email@example.com hostmaster: firstname.lastname@example.org usenet: email@example.com news: firstname.lastname@example.org webmaster: email@example.com www: firstname.lastname@example.org ftp: email@example.com abuse: firstname.lastname@example.org noc: email@example.com security: firstname.lastname@example.org root: email@example.com jessica: firstname.lastname@example.org monit: email@example.com
Then ran the
newaliases command and restarted exim4 with
sudo service exim4 restart.
All root emails are ending up in my client’s inbox (firstname.lastname@example.org), due to the catch all we set up in G Suite. I expected the server to read the
/etc/aliases file and send them to me (email@example.com) instead… but it seems this file is being completely ignored!
How can I make sure all server-related emails are sent to me instead of my client?
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×