> # /etc/postfix/sender_maps.regexp
> /@example\.com$/  [192.168.10.3]
> /./  [192.168.10.5
>
> - do not index a regexp table with postmap.
> - you can use pcre rather than regexp above if your postfix supports pcre
> tables.

Ah I misunderstood the precedence, thinking that relayhost in main.cf
would be the fallback/catchall. So I tried what you suggested and I
believe my problem now might only be regex related?

So, in main.cf, I went with pcre since my instance of postfix doesn't
support regex:
sender_dependent_relayhost_maps = pcre:/etc/postfix/sender_maps.pcre


For troubleshooting, I tried setting the "catch all" entry to what I
want to relay to (billing.domain2.com) - just to force it so I know
this rule is doing something. Doing that works:

/@billing\.domain2\.com$/       billing.domain2.com
/./  [billing.domain2.com]

But when I set it to what I'm trying to do:

/@billing\.domain2\.com$/       billing.domain2.com
/./  [mail.domain1.com]

It seems like it's not matching correctly, though the syntax seems right.

Reply via email to