Skip to content
Nigel Metheringham edited this page Nov 29, 2012 · 2 revisions

Question

I want to rewrite recipient address depending on the domain of the sender... qend

For example:

*@example.com        *                        FtTq
\N^.+@mr-spark\N     [email protected]  FtT
\N^.+@rewind\N       [email protected]   FtT
\N^.+@eug\N          [email protected]       FtT
\N^.+@tux\N          [email protected] FtT
\N^.+@proj-ws-43\N   [email protected] FtT
\N^.+@proj-lx-29\N   [email protected] FtT
*@example.com        *                        FtTq
*                    developer@localhost      FtT

So I want the following:

  1. If mail is sent for *@example.com then it will be sent to *@example.com

  2. If mail is sent from *@rewind then it will be sent to [email protected]

  3. If mail is sent from *@eug then it will be sent to [email protected]

  4. ...

  5. Otherwise mail will be send to local mailbox developer@localhost

But the rules don't work property, for example:

If I use exim -brw kamenskiyvv@proj-lx-29 it all works well:

sender: kamenskiyvv@proj-lx-29
from: kamenskiyvv@proj-lx-29
to: [email protected]
cc: kamenskiyvv@proj-lx-29
bcc: kamenskiyvv@proj-lx-29
reply-to: kamenskiyvv@proj-lx-29
env-from: [email protected]
env-to: [email protected]

But if I send mail from proj-lx-29 host I will see the following in the log:

2007-10-31 13:51:39 1InDyt-0007Zy-0O <= [email protected] H=proj-lx-29 [192.168.9.29] P=smtp S=418
2007-10-31 13:51:39 1InDyt-0007Zy-0O => developer <developer@localhost> R=localuser T=local_delivery
2007-10-31 13:51:39 1InDyt-0007Zy-0O Completed

Answer

Your rules are incorrect, exim rewrites only addresses that are matched with expression. If rule can be applied to only From header it will be applied to From Header only.


Clone this wiki locally