Hi! I'm trying to implement a relatively esoteric use case right now, where all the mails I sent to postfix on a specific smtp daemon configured in the master.cf to a different nexthop than the regular mail going through the services. But this should only occur for a list of domains (my internal domains, which should be routed to a backend mailbox server) - mail for external recipients should be routed through the normal outbound mail service.
I tried to implement that by adding another smtpd service with a different rewrite_service_name set, and started an additional trivial-rewrite with the -o transport_maps set to a different hash table, where I have put in my internal domains. I can see in the log file that the trivial rewrite resolves the next hop correctly from the extra transport map, and sends that back to the smtpd, but the information is ignored when it comes to the smtp process. I suspect this is the wanted behavior, so I'm trying to figure out right now where the transport_maps entry to the next hop is resolved? Is that in the qmgr? It would make sense, as the routing information could change, and the nexthop information from the smtpd could be totally outdated by the time a delivery succeeds. Relevant configuration and logs: main.cf: appmail_transport_maps = hash:/etc/postfix/extratransport master.cf: 10.0.0.55:587 inet n - y - - smtpd -o smtpd_banner=appmail -o syslog_name=smtpd_appmail -o rewrite_service_name=appmailtransports appmailtransports unix - - y - - trivial-rewrite -v -o transport_maps=$appmail_transport_maps /etc/postfix/extratransport: p-square.de smtp:[10.0.0.1] Excerpt from mail.info for a test domain: Mar 15 15:00:14 menchi postfix/trivial-rewrite[1125]: match_list_match: p-square.de: no match Mar 15 15:00:14 menchi postfix/trivial-rewrite[1125]: maps_find: transport_maps: jens.hoffrich...@p-square.de: not found Mar 15 15:00:14 menchi postfix/trivial-rewrite[1125]: maps_find: transport_maps: hash:/etc/postfix/extratransport(0,lock|no_regsub|fold_fix|utf8_request): p-square.de = smtp:[10.0.0.1] Mar 15 15:00:14 menchi postfix/trivial-rewrite[1125]: mail_addr_find: jens.hoffrich...@p-square.de -> smtp:[10.0.0.1] Mar 15 15:00:14 menchi postfix/trivial-rewrite[1125]: `b...@blupp.de' -> `jens.hoffrich...@p-square.de' -> (`smtp' `[10.0.0.1]' `jens.hoffrich...@p-square.de' `4096') Mar 15 15:00:14 menchi smtpd_appmail/smtpd[1122]: C2695742C638: client=emby.whaleisland.casa[10.0.0.12] Mar 15 15:00:17 menchi postfix/cleanup[1126]: C2695742C638: message-id=<> Mar 15 15:00:17 menchi postfix/qmgr[1109]: C2695742C638: from=<b...@blupp.de>, size=206, nrcpt=1 (queue active) Mar 15 15:00:47 menchi postfix/smtp[1111]: connect to psquare-de0c.mail.protection.outlook.com[104.47.9.36]:25: Connection timed out Mar 15 15:01:17 menchi postfix/smtp[1111]: connect to psquare-de0c.mail.protection.outlook.com[104.47.8.36]:25: Connection timed out Mar 15 15:01:17 menchi postfix/smtp[1111]: C2695742C638: to=<jens.hoffrich...@p-square.de>, relay=none, delay=71, delays=10/0/60/0, dsn=4.4.1, status=deferred (connect to psquare-de0c.mail.protection.outlook.com[104.47.8.36]:25: Connection timed out) This was just a quick and dirty test setup to confirm the things I was seeing on a server with much less access than to the test box, so nothing here is set in stone. But the experience here is the same as on the other box. Thanks for any insights into the process! Jens