Change sender domain of system generated mail

I don’t have a guide for this specifically but basically you can create a file inside /etc/exim4/conf.d/rewrite/00-my-rewrite-header
And use the basic rewriting of exim.

[email protected] [email protected] SFfrs

The flags have the following meanings:

  1. S - Do all rewriting at SMTP time. This means that all of the following flags are done immediately as the data they apply to is coming in, not delayed until later.
  2. F - Rewrite the envelope from field.
  3. f - Rewrite the From: header field.
  4. r - Rewrite the Reply-To: header field.
  5. s - Rewrite the Sender-To: header field.

Read Chapter 31 of the Exim Specification for more detail on message rewriting.

Credit for the answer on ServerFault: email - Exim: Change sender address when sending mails out of local network - Server Fault

2 Likes