Score:1

exim4 doesn't apply aliases to outgoing mail

np flag

I'm not recieving error messages from my server, because they get bounced by my email provider for having an invalid "To:" address.

I have a working mail setup - I can use mail to send email addresses as root or myself, and they appear in my inbox from the address specified in /etc/email-addresses. It's a basic Debian smarthost setup.

root@statler:/etc/exim4# cat /etc/aliases
# /etc/aliases
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: [personalemailaddress]
sandy: [personalemailaddress]

root@statler:/etc/exim4# cat /etc/email-addresses
# This is /etc/email-addresses. It is part of the exim package
...
root: [personalemailaddress]
sandy: [personalemailaddress]

root@statler:/etc/exim4# exim -brw root@statler
  sender: [personalemailaddress]
    from: [personalemailaddress]
      to: root@statler
      cc: root@statler
     bcc: root@statler
reply-to: [personalemailaddress]
env-from: [personalemailaddress]
  env-to: root@statler

How can I get exim to apply these aliases so the mail gets a valid address?

I'm using Debian bullseye.

anx avatar
fr flag
anx
Related [answer](https://serverfault.com/a/916292/250204) on rewriting headers afterwards vs. avoiding producing inappropriate ones in the first place.
anx avatar
fr flag
anx
"for having an invalid address" - so why not address that hostname/domain configuration directly, *before* it is written into messages then inappropriate for internet mail exchange?
sandyscott avatar
np flag
@anx Thanks for that link, that's helpful. However, I think my problem was caused by a typo, so I feel somewhat silly now. As for the question of why I'm doing it - it's basically the case described in that answer - It's a webserver (ie. not a mailserver) and if **any** bit of software sends a message to `root@host` I want to get it in my inbox, ideally without having to embed my email address in every config file.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.