On Thu, Mar 13, 2025 at 04:24:42PM +0100, rog7993--- via Postfix-users wrote:

> Thanks for the quick reply. I tried the second variant because it
> seems less invasive for the existing configuration than variant 1. I
> don't see all the consequences of deleting the domain from
> virtual_alias_domains and adding it to virtual_mailbox_domains.

When I said option 1 is simpler, I meant what I said.  There's nothing
more to it than described.  Transforming a virtual alias domain to a
virtual mailbox domain, while (almost) all the recipients are rewritten
to other domains has no effect on the rewritten recipients, they work
exactly as before, but now you free to leave some recipients not
rewritten, and route them as-is, e.g. by setting virtual_transport.

> Unfortunately variant 2 did not work. The generic rewrite does not
> take place. So the verbatim.invalid address is used for the final
> delivery.

Well, you haven't posted the actual configuration you created, or any
logs, so it is hard to say where you went wrong.  As documented,
"smtp_generic_maps" rewrites the envelope and headers.  This does not
affect logging, which shows the address selected for delivery, but the
rewritten address is sent in the SMTP "RCPT TO:" command to the remote
system.

> > You have two choices (the first is probably simpler):
> > 
> >      1. Remove the domain from virtual_alias_domains, and instead
> >         list it in virtual_mailbox_domains:
> > 
> >          main.cf:
> >              virtual_mailbox_domains = example.com
> >              default_database_type = hash
> >              indexed = ${default_database_type}:${config_directory}/
> >              virtual_alias_maps = ${indexed}virtual
> >              virtual_transport = relay:[mailstore.example]
> >              transport_maps = ${indexed}transport
> > 
> >          virtual:
> >              ...
> >              # Delivered verbatim via $virtual_transport
> >              us...@examp.com     us...@example.com
> > 
> >      2.  Leave the domain alone, but rewrite the recipient address
> >          back to original form during delivery:
> > 
> >          main.cf:
> >              virtual_alias_domains = example.com
> >              default_database_type = hash
> >              indexed = ${default_database_type}:${config_directory}/
> >              smtp_generic_maps = ${indexed}generic
> >              virtual_alias_maps = ${indexed}virtual
> >              transport_maps = ${indexed}transport
> > 
> >          virtual:
> >              ...
> >              # Transient rewrite
> >              us...@example.com   us...@example.com.verbatim.invalid
> > 
> >          transport:
> >              example.com.verbatim.invalid    relay:[mailstore.example]
> > 
> >          generic:
> >              # Undo recipient rewrite
> >              us...@example.com.verbatim.invalid  us...@example.com

You'll need to post "postconf -nf" output (preserving whitespace and
linebreaks), ditto for "postconf -Mf" output, and relevant logs.

Also evidence that the RHS of the rewrite of "user2" in virtual aliases
is a matching LHS in the generic table, with the RHS equal to the
original address.

Show "postmap -q" queries, any changes to obfuscate the localpart or
domains need to preserve distinctions while ensuring identical values
map to identical replacements.

-- 
    Viktor.
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to