-
Notifications
You must be signed in to change notification settings - Fork 178
Q0801
How can I get Exim to strip the hostname from the sender's address?
If you set up a rewriting rule in the following form:
*@*.your.domain [email protected]
then Exim will rewrite all addresses in the envelope and the headers,
removing anything between @
and your.domain
. This applies to all
messages that Exim processes. If you want to rewrite sender addresses
only, the the rule should be
*@*.your.domain [email protected] Ffrs
This applies the rule only to the envelope sender address and to the From:, Reply-to:, and Sender: headers.
The same rules can also be used if you want to ensure that the envelope sender is always set to the From: address. This is highly useful on a web hosting server where most people just install whatever programs they find and they don't use the -f or Return-path: headers to set the envelope sender. When they do this and a bounce occurs, the webmaster doesn't get the bounce mail, so they don't know that there is a problem. To fix this use:
*@*.your.domain ${sg{$h_from:}{^.*<(.*)>}{\$1}} Ffrs
This causes [[email protected]](mailto:[email protected]) to be replaced with their From: header. And if they've entered a full From address, then it will strip the e-mail from "User name" <user@domain>. This helps in tracking down the mail a lot, and makes sure that customer's get their bounces.
Unfortunately the example above doesn't work if your mail or rcpt ACL has a "verify = sender" line, because that causes the return-path rewrite to happen before the mail headers (and thus the From: address) are available. A solution is to rewrite the envelope-from (return-path) from the smtp transport. An example:
remote_smtp:
driver = smtp
return_path = ${if eq{$return_path}{[email protected]}{${address:$h_from:}}fail}
- How can I get Exim to strip the hostname from the sender's address?
- I have Exim configured to remove the hostname portion of the domain on
- I want to rewrite local addresses in mail that goes to the outside
- I'm using this rewriting rule to change login names into friendly names, but if mail comes in for an upper case login name, it doesn't get rewritten.
- Is it possible to completely fail a message if the rewrite rules fail?
- I'm using $domain as the key for a lookup in a rewriting rule, but
- I want to rewrite local sender addresses depending on the domain of the
- I want to rewrite recipient address depending on the domain of the