postfix config: how to relay mails for only one user of a certain domain

Hello there,

First of all I tell you that this is my first postfix installation so please be patient…

I have following scenario:

fetchmail → postfix → amavis-new → postfix → exchange 2010. Everything -except exchange ;-)- runs on an opensuse 12.1 box.

Now, I have a list of domains entirely managed and hosted here so I have resolved everything using the transport file (do.main.name smtp:
[exchange.ser.ver]) and the entries in the main.cf file (mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, do.main.one,
do.main.two, domain.diffi.cult).

So far so good, everything seems to work for the “simple” domains.

Now, I have got one user with an address at domain.diffi.cult and this domain is not hosted by me. This user has a mailbox on the exchange server and everything is working fine on that side.

How can I configure postfix to deliver the mails for myuser@domain.diffi.cult locally and all the others @domain.diffi.cult to the internet?

Just a further clarification…
I am the owner of those “simple-to-manage” domains. All the managed domains are regularly polled with fetchmail, scanned for spam/viruses with amavis and then sent to the users mailboxes on exchange. Those domains can be easily managed locally because all user of those domains also have an exchange mailbox.

The user @ the difficult domain also has an exchange mailbox and has to send and receive mails using outlook/exchange. His address @ that domain must continue being used because it’s an old known address. Within Exchange everything works fine: if he sends mails to the other users/domains it works, if the other users/domains send mails to him it works.

The problem is that if I declare in postfix that domain as local, postfix tries to deliver all the mails addressed to users @ the difficult domain locally (to the exchange server) and that is wrong because they don’t belong to the local organization thus -of course- aren’t managed locally.

I succeeded in having a working config based on sendmail, but now for some reasons I have to switch to postfix.

Any clue anybody?

Thanks
Luca

Your post seems a bit confusing to me…
I see that the Exchange server with the “cult” mail Domain is remotely hosted,

But I’m unclear for sure whether both your postfix servers are located in your local network (I’m guessing that’s the case), and whether one or both postfix servers are also your outbound “SMTP Smart Servers” for your network (again, I’m guessing that’s the case).

Also, I really don’t understand why this special User has mail delivered to more than one place… I assume that his mail <should> be managed and stored in the same Exchange mailserver as the other users in that mail domain, but maybe that’s not the case? – And if his mail is really managed and stored elsewhere, where? – On one of the postfix servers or otherwise in the same network?

In any case, with all this confusion, in the past if I wanted to solve the type of problem you might be describing which is to route mail in the same mail domain differently, I’d setup a second mail relay (eg postfix) with different rules, then point <some> users to it… but that’s more typically for outbound whereas you might be describing something inbound.

HTH,
TS