Skip to content
Slavko edited this page Nov 28, 2020 · 3 revisions

Q0426


`Navigation(siblings)`_


Q0426

Question

One of the things I want to set up is for anything@onedomain to forward to anything@anotherdomain. I tried adding $local_part@anotherdomain to my aliases but it did not expand - it sent it to that literal address.

Answer

If you want to do it that way, you can use the expand operator on the lookup used in the data option of the redirect router. For example:

data = ${expand:${lookup{$local_part}lsearch*{/etc/aliases}}}

Another approach is to use a router like this:

forwarddomain:
  driver = redirect
  domains = onedomain
  data = $local_part@anotherdomain

The value of data can, of course, be more complicated, involving lookups etc. if you have lots of different cases.


Clone this wiki locally