Le 07/12/2010 14:25, Michael Holt a écrit :
Hi list..

I have an issue with postfix resolving a domain - correctly, yet i want
it to resolve differently..

The story so far..

Dec 7 00:39:06 newserver postfix/smtpd[13222]: connect from
mail-wy0-f176.google.com <http://mail-wy0-f176.google.com> [74.125.82.176]
Dec 7 00:39:06 newserver postfix/smtpd[13222]: 7D53D5C0BB:
client=mail-wy0-f176.google.com
<http://mail-wy0-f176.google.com>[74.125.82.176]
Dec 7 00:39:06 newserver postfix/cleanup[13225]: 7D53D5C0BB:
message-id=<[email protected]
<mailto:[email protected]>>
Dec 7 00:39:06 newserver postfix/qmgr[3002]: 7D53D5C0BB:
[email protected] <mailto:[email protected]>, size=1851,
nrcpt=1 (queue active)
Dec 7 00:39:34 newserver postfix/smtpd[13229]: connect from
localhost[127.0.0.1]
Dec 7 00:39:35 newserver postfix/smtpd[13229]: 15DE05C0BC:
client=localhost[127.0.0.1]
Dec 7 00:39:35 newserver postfix/cleanup[13225]: 15DE05C0BC:
message-id=<[email protected]
<mailto:[email protected]>>
Dec 7 00:39:35 newserver postfix/smtpd[13229]: disconnect from
localhost[127.0.0.1]
Dec 7 00:39:35 newserver postfix/qmgr[3002]: 15DE05C0BC:
from=<[email protected] <mailto:[email protected]> >, size=2515,
nrcpt=1 (queue active)
Dec 7 00:39:35 newserver postfix/error[13203]: 15DE05C0BC:
to=<[email protected]_ <mailto:[email protected]>__>,
orig_to=<[email protected]_ <mailto:[email protected]>__>,
relay=none, delay=0.34, delays=0.21/0.04/0/0.09, dsn=4.4.1,
status=deferred (delivery temporarily suspended: connect to
oldserver._example.com_ <http://example.com>__[81.100.100.100]:25:
Connection timed out)
Dec 7 00:39:35 newserver amavis[2308]: (02308-19) Passed CLEAN,
[74.125.82.176] [74.125.82.176] <[email protected]
<mailto:[email protected]>> -> <[email protected]_
<mailto:[email protected]>__>, Message-ID:
<[email protected]
<mailto:[email protected]>>, mail_id:
3a5Ulw9LI+7k, Hits: 0.096, size: 1851, queued_as: 15DE05C0BC, 24605 ms
Dec 7 00:39:35 newserver postfix/smtp[13226]: 7D53D5C0BB:
to=<[email protected] <mailto:[email protected]>>,
relay=127.0.0.1[127.0.0.1]:10024, delay=29, delays=0.42/0.03/8.5/21,
dsn=2.0.0, status=sent (250 2.0.0 Ok, id=02308-19, from
MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 15DE05C0BC)
Dec 7 00:39:35 newserver postfix/qmgr[3002]: 7D53D5C0BB: removed
Dec 7 00:39:36 newserver postfix/smtpd[13222]: disconnect from
mail-wy0-f176.google.com <http://mail-wy0-f176.google.com> [74.125.82.176]

My issue is

(delivery temporarily suspended: connect to oldserver._example.com_
<http://example.com>__[81.100.100.100]:25: Connection timed out)

oldserver.example.com <http://oldserver.example.com> has an internal,
and external ip address..

81.100.100.100 as postfix has found out, is the correct address..
external ip address..
however, on a handful of domains, which are on a second mail server
internaly, i need postfix to resolve to the internal ip.. eg 192.168.0.20

the time out is happening as the external ip address doesn't relate to
anything on the network.. correctly..

my initial thoughts were to alter the hosts file

mufasa:~# more /etc/hosts
127.0.0.1 localhost
127.0.1.1 newserver.example.com <http://newserver.example.com> newserver
192.168.0.20 oldserver.example2.com <http://oldserver.example2.com>

which when I ping oldserver.example2.com <http://oldserver.example2.com>
i get as expected

newserver:~# ping oldserver.example2.com <http://oldserver.example2.com>

PING oldserver.example2.com <http://oldserver.example2.com>
(192.168.0.20) 56(84) bytes of data.
64 bytes from oldserver.example2.com <http://oldserver.example2.com>
(192.168.0.20): icmp_seq=1 ttl=64 time=5.56 ms
64 bytes from oldserver.example2.com <http://oldserver.example2.com>
(192.168.0.20): icmp_seq=2 ttl=64 time=0.228 ms
64 bytes from oldserver.example2.com <http://oldserver.example2.com>
(192.168.0.20): icmp_seq=3 ttl=64 time=0.302 ms

i.e the internal ip address, so the hosts file change worked..

yet, after restarting everything, postfix still resolves to the external
address...


may be you have a chroot issue. please show your master.cf.

that said, what would be the benefit of putting the info in /etc/hosts compared to transport_maps?


it would be better using a local dns recursive server that resolves internal domains. unbound is a good choice.



So.. some googleing, and reading back on this list, i think this could
have somthing to do with it..

smtp_host_lookup

I read about it, and it said that it will always lookup the dns, then
the native, so i tried swapping them about

smtp_host_lookup = native,dns

but after all the restarts, its still giving the postfix log above..
i.e. its still resolving to the external ip..

Is there any way to get it to resolve a handful of domains to the
internal ip address??

Fast approaching the edges of my knowledge and its uncomfortable!! tbh,
i think i may have passed the edge a few steps ago!!

Any help would be appreciated..

Michael

Reply via email to