2

I am trying to forward system email (from apt, cron, etc.) addressed to "root" to my personal email address using a smarthost. I am using Debian 9. First, I ran sudo dpkg-reconfigure exim4-config. This is the contents of /etc/exim4/update-exim4.conf.conf (I replaced all occurrences of my domain name with "example.com"):

dc_eximconfig_configtype='satellite'
dc_other_hostnames=''
dc_local_interfaces='127.0.0.1 ; ::1'
dc_readhost='example.com'
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='mail.messagingengine.com::587'
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname='true'
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'

I also set the correct password in /etc/exim4/passwd.client I can now successfully send mail to any email address with sendmail, mailx, etc.

Second, I edited /etc/aliases to contain the following:

mailer-daemon: postmaster
postmaster: root
nobody: root
hostmaster: root
usenet: root
news: root
webmaster: root
www: root
ftp: root
abuse: root
noc: root
security: root
root: [email protected]

But, when I try to send an email to "root" with echo Hi | mailx root I see the following error in /etc/exim4/mainlog:

SMTP error from remote mail server after RCPT TO:<[email protected]>: 550 5.1.1 <[email protected]>: Recipient address rejected: User unknown in local recipient table

I thought I told Exim4 to redirect email for root to "[email protected]". But instead it is redirecting it to "[email protected]". Why is Exim4 not honouring my /etc/aliases? How should I setup Exim4 to redirect email for root to my personal email address?

2 Answers 2

2

The satellite configuration sends ALL email to the specified smarthost. No local delivery is considered, so the /etc/aliases file is not consulted.

If you want to have local delivery considered you should change the configuration type from satellite to smarthost.

0

You might also want to check /etc/email-adresses --> https://manpages.debian.org/testing/exim4-config/etc-email-addresses.5.en.html

1
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From Review
    – Dave M
    Jan 22, 2023 at 16:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .