On Tue, Apr 25, 2017 at 07:26:38AM +0000, Dennis Weber wrote:

> I have changed my configuration with your recommendation, but the Exchange
> server behind the gateway is still receiving mails for us...@example.com
> instead of user1@internal1.example.

Please post your configuration as explained in:

    http://www.postfix.org/DEBUG_README.html#mail

This should also include "postconf -Mf" output with the original
line breaks, do not let Outlook or other mail client reformat the
command output.  Attach as a text file if your mail client is too
difficult to configure to not mangle pasted text.

Also include sample lines from transport, virtual, generic, that
are relevant to the problem at hand.  If you obfuscate addresses,
make sure that each original domain becomes a distinct obfuscated
domain and each original email address localpart becomes a distinct
obfuscated localpart.

> Postfix Log:
> postfix/smtp[15949]: 08F37AE307: to=<user1@internal.example>, 
> orig_to=<us...@example.com>, relay=10.0.0.8[10.0.0.8]:25, delay=0.4, 
> delays=0.04/0.02/0.04/0.3, dsn=2.6.0, status=sent (250 2.6.0 
> <som...@am5pr0402mb2785.eurprd04.prod.outlook.com> [InternalId=someid] Queued 
> mail for delivery)

The log entry above shows the opposite of what you say.  The message
came in addressed to (orig_to=) <us...@example.com> and was delivered
to (to=) <user1@internal.example>.  Exactly as you asked.  

However, what this does not show is any generic(5) rewriting
performed by the SMTP delivery agent on the fly while delivering
the message.  Perhaps you did not manage to hand the message off
to the right ("relay") transport, or to configure that transport
to not perform the generic(5) rewriting you want for outbound mail.

> Exchange Queue:
> Last Error: A local loop was detected.
> Queue ID: SRV-EXCH01\Submission
> Recipients:  us...@example.com;2;0;;0;

> On the way outgoing everything looks fine, the "From" Field and "Return-To"
> are rewritten by generic and the mail is delivered fine, only the way
> incoming won't work.
> 
> Any idea on what I am doing wrong?

Either a problem within Exchange, or failure to fully implement
the recipe.  Another possibility is that you've not explained what
you're asking for clearly enough.  Perhaps the envelope recipient
you want to hand to Exchange is not the <user1@internal.example>
form.

-- 
        Viktor.

Reply via email to