> On Apr 25, 2017, at 5:31 PM, Dennis Weber <dennis.we...@atwork-it.com> wrote: > > Hi Viktor, > > thank you a lot for your time and effort! > > I have now activated the verbose option on my smtp and trivial-rewrite and > was analyzing the connection log.
You made the incoming stmpd(8) verbose, but all the interesting stuff happens in the outgoing smtp(8), for which the logs have only: Apr 25 23:00:19 srv-rewr01 postfix/smtp[20290]: Untrusted TLS connection established to 10.0.0.8[10.0.0.8]:25: TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits) Apr 25 23:00:19 srv-rewr01 postfix/smtp[20290]: 34DE4AE307: to=<test.tester...@oldcorp1.com>, orig_to=<test.tester...@newcorp.com>, relay=10.0.0.8[10.0.0.8]:25, delay=0.52, delays=0.08/0/0.04/0.4, dsn=2.6.0, status=sent (250 2.6.0 <am5pr0402mb278530d3d61fc0e224ad6466c3...@am5pr0402mb2785.eurprd04.prod.outlook.com> [InternalId=2486786064455] Queued mail for delivery) The rewriting upstream of smtp(8) happened exactly as I understood you to have said you wanted upthread. > The Exchange server at "internal.example" (oldcorp1.com) receives the mail > "for" us...@example.com, > but "To" user1@internal.example and therefore it is looping back to the > postfix system. > The RCPT TO is going to the wrong address. That is *not* how Exchange works. It does not care at all about the content of the message headers. The delivery is based entirely on the message envelope recipient address. In this case <test.tester...@oldcorp1.com>. That address is matched (after prepending "smtp:") against the LDAP proxyAddresses attribute in Active Directory. What proxyAddresses in Exchange are associated with "test.testersen"? Report the "mail", "SAMAccountName" and "proxyAddresses" attributes of the relevant user object. > <generic_rewrite_outgoing><postconf_Mf.txt><postconf_n.txt><recipient_canonical><transport_rules> These looked mostly ok. You should not use or need "recipient_canonical" mappings. You did not post the relevant entries from the virtual_alias table. -- Viktor.