Hi Dennis,

Thank you very much and please excuse the delay but I had too many open 
issues...

Now postfix delivers everything @ that.domain to their mailer, also for the 
user I manage locally:

Mar  4 12:24:07 server6 postfix/trivial-rewrite[7155]: warning: do not list 
domain that.domain in BOTH mydestination and virtual_alias_domains
Mar  4 12:24:07 server6 postfix/smtpd[7196]: E4F484383F: 
client=localhost[127.0.0.1]
Mar  4 12:24:07 server6 postfix/cleanup[7154]: E4F484383F: 
message-id=<20120304112403.0d36343...@server6.xxx.yyy.zz>
Mar  4 12:24:07 server6 postfix/qmgr[7098]: E4F484383F: 
from=<r...@server6.xxx.yyy.zz>, size=1225, nrcpt=1 (queue active)
Mar  4 12:24:07 server6 postfix/smtpd[7196]: disconnect from 
localhost[127.0.0.1]
Mar  4 12:24:07 server6 postfix/trivial-rewrite[7155]: warning: do not list 
domain that.domain in BOTH mydestination and virtual_alias_domains
Mar  4 12:24:07 server6 postfix/smtp[7156]: 0D36343840: 
to=<my.user@that.domain>, relay=127.0.0.1[127.0.0.1]:10024, delay=4.9, 
delays=0.02/0.02/0/4.9, dsn=2.0.0, status=sent (250 2.0.0 from 
MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as E4F484383F)
Mar  4 12:24:07 server6 postfix/qmgr[7098]: 0D36343840: removed
Mar  4 12:24:08 server6 postfix/smtp[7197]: E4F484383F: 
to=<my.user@that.domain>, relay=that.domain[xxx.xxx.xxx.xxx]:25, delay=0.84, 
delays=0.01/0.01/0.32/0.5, dsn=2.0.0, status=sent (250 Ok. 4F5350D8.00001E6E)
Mar  4 12:24:08 server6 postfix/qmgr[7098]: E4F484383F: removed

I am sure I did something wrong, but I am still too much of a bloody newbie in 
matter postfix to be able to discover what... :-(

These are my settings:

main.cf:
virtual_alias_domains = hash:/etc/postfix/virtual, /etc/postfix/local-host-names
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, 
domain1, domain2, domain3, ..., that.domain
alias_maps = hash:/etc/aliases
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_dependent_relayhost
transport_maps = hash:/etc/postfix/transport

------

relay_recipients:
@domain1                     OK
@domain2              OK
@domain3                       OK
...
my.user@that.domain        OK

------

sender_dependent_relayhost:
my.user@that.domain     smtp:[exchange.ser.ver]

------

Transport:
domain1                      smtp:[exchange.ser.ver]
domain2                      smtp:[exchange.ser.ver]
domain3                      smtp:[exchange.ser.ver]
...
that.domain                       smtp:[ that.domain]
.that.domain                      smtp:[ that.domain]

------

/etc/aliases:
## aliases for the Exchange Server on server1
...
myuser:      my.user@that.domain


I would be very grateful fon any hint...

Thanks so much in advance,
Luca


-----Original Message-----
From: owner-postfix-us...@postfix.org [mailto:owner-postfix-us...@postfix.org] 
On Behalf Of Dennis Guhl
Sent: Freitag, 24. Februar 2012 14:38
To: postfix-users@postfix.org
Subject: Re: How do I handle mails for only one user of a certain domain?

On Thu, Feb 23, 2012 at 07:21:03PM +0000, Luca Pacor wrote:
> 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
> myu...@domain.diffi.cult<mailto:myu...@domain.diffi.cult> locally
> and all the others @domain.diffi.cult to the internet?

Change the entry for domain.diffi.cult and .domain.diffi.cult in your
transport map to the MX for this domain:

        domain.diffi.cult       smtp:domain.diffi.cult
        .domain.diffi.cult      smtp:domain.diffi.cult

For myu...@domain.diffi.cult add a sender_dependent_relayhost_maps
(http://www.postfix.org/postconf.5.html#sender_dependent_relayhost_maps)
in your main.cf and point your user to your exchange:

        myu...@domain.diffi.cult        smtp:[exchange.ser.ver]

Dennis

[..]
***************************** ***************************** This e-mail and any 
files transmitted with it may contain confidential and/or privileged 
information. If you are not the intended recipient (or have received this 
e-Mail in error) please notify the sender immediately and destroy this e-mail. 
unauthorized copying, disclosure or distribution of the material in this e-mail 
without the prior authorization of the sender is strictly forbidden. Please 
also note that while our own software systems have been used to try to ensure 
that this e-mail has been swept for viruses and other malicious contents using 
the latest virus signatures, we do not accept responsibility for any damage or 
loss caused in respect of any viruses transmitted by the e-mail. Please make 
sure that your own checks are carried out before any attachments are opened. If 
you feel you have received this E-mail in error please e-mail 
postmas...@solid-con.com (c) Solid Consulting Limited & Co. KG 2012 
***************************** ****************************

Reply via email to