On Tue, Nov 10, 2020 at 06:05:02PM -0500, Alex wrote: > > > This should work provided nothing causes the mail to take some other > > route. The routing logic is: > > > > 1. Highest priority, any content_filter override. > > 2. Next, the transport(5) table. > > 3. Next, the address-class-specific transport, i.e. > > relay_tansport for relay_domains, local_transport for > > domains listed in mydestination, ... > > 4. Next, default_transport possibly sender-dependent via > > sender_depedent_default_transport_maps. > > Where would virtual_maps or virtual_alias_domains be processed?
Recipient rewriting via virtual(5) happens early during message input in cleanup(8). By the time the message is being delivered any configured and not disabled virtual(5) rewriting is complete. The virtual_alias_domains parameter makes a domain "final", which allows mail to these domains to not be rejected by "reject_unauth_destination". If, for some reason, a recipient in one of these domains fails to be rewritten to some real domain, that recipient will be routed to the error(8) transport and will bounce. The transport table does not override virtual_alias_domains, absent the requisite rewrites they bounce regardless of any transport table entries. > > See above, the transport table is the highest-precedence source > > of truth after content_filter. > > If I want to use the transport table to contain the list of domains > which should be processed through amavis, should I be able to disable > the content_filter and define the domains in the transport_map like: > > domain1.org smtp-amavis:[127.0.0.1]:10024 I don't see why you'd want to do that, but you certainly can. Typically, all recipients would be sent to the filter. > and expect it to work properly? Is that the proper way to do it, > assuming everything else (like mydestination, etc) is configured > properly? Typically, no transport table is used upstream of the filter, and you just define default_transport, relay_transport and virtual_transport. On Tue, Nov 10, 2020 at 11:04:09PM -0500, Alex wrote: > > and expect it to work properly? Is that the proper way to do it, > > assuming everything else (like mydestination, etc) is configured > > properly? > > Also, if the transport_map instructs postfix to send all mail for the > domain to port 10024, and amavisd then sends it back to 10025, how > does postfix then know to eventually forward it on to its final > destination after the email has been processed? You say "how does Postfix", as though there is just one Postfix, but you have multiple Postfix instances, each configured to do its job. Only the pre-filter Postfix instance sends mail into Amavis. The port 10025 smtpd(8) listen would be in the post-filter instance. -- Viktor.