On Tue, Feb 02, 2021 at 06:12:01PM -0800, david wrote: > At 06:07 PM 2/2/2021, Viktor Dukhovni wrote: > >On Tue, Feb 02, 2021 at 06:46:32PM -0700, Bob Proulx wrote: > > > > > > > > > > a...@d1.tld d1_a > > > > b...@d1.tld d1_b > > > > @d1.tld owner_d1 > > > > @d2.tld owner_d2 > > > > > > I don't see anything wrong as such with the above. Seems like it > > > should work. And for me I have a very similar arrangement here. So I > > > modified it so that I could test the above case here. It worked for > > > me here. > > > >Look more closely. The table as written cannot meet the OP's goals. > >So, no, it does not look like it should work. It is expected to rewrite > >all the recipients to owner_d1, as reported by the OP.
> Why would the line > @d1.tld owner_d1 > apply to ALL recipients? I want it to apply to recipients at d1.tld, > not d2.dld. What am I missing? This is an easy question, that I was hoping someone else would field for a change. 1. Rewriting via virtual(5) is recursive, with recursion stopping either when there's no result, or a key maps to itself. 2. Unqualified RHS values are qualified by appending @$myorigin Each of these independently makes your table not sufficient for your needs, in combination it is doubly unsuitable. The correct syntax is: @d1.tld owner...@d1.tld a...@d1.tld d...@d1.tld b...@d1.tld d...@d1.tld owner...@d1.tld owner...@d1.tld @d2.tld owner...@d2.tld owner...@d2.tld owner...@d2.tld When using wildcard mappings, always add explicit identity mappings for RHS values that should not be further expanded. Always append explicit domains to RHS values in virtual(5), unless you specifically mean for them to expand to localport@$myorigin with the suffix defined externally in main.cf. Finally, in some cases consider setting "append_mydomain = yes", if you want to use "localpart@hostname" in tables, without having to specify an explicit ".$mydomain" suffix after the hostname. Note that this is "$mydomain" not "$myorigin" as above. Good luck. Lots of folks on this list know the answer to this question, I guess most of them have not paid attention to this thread (yet). -- Viktor.