Hello
I’m trying to set up postfix to route all mail to certain domains to a server defined in /etc/hosts like so:
[local IP] exchange.local exchange
This is an assp install, which is all working fine apart from inbound email which I want to be delivered to our exchange box
I have added the following lines to /etc/postfix/transport domain1.co.uk smtp:[exchange.local] domain2.net smtp:[exchange.local]
I have also configured KMail to point at postfix for testing so I can be sure that outbound mail routes correctly, but any email sent to domain1 or domain 2 returns an error in /var/log/mail as follows:
dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=exchange.local type=AAAA: Host not found)
Which is strange because I can ping exchange.local and get replies from the correct IP, and I can telnet exchange.local 25 and see the SMTP dialogue.
I think this is a problem with how I have network/routing/hosts set up in SuSE rather than a postfix problem so I’m asking here first. Does anyone have any clues for me?
thanks very much in advance.
On 2013-02-12 15:26, MoratOV wrote:
> dsn=5.4.4, status=bounced (Host or domain name not found. Name service
> error for name=exchange.local type=AAAA: Host not found)
>
> Which is strange because I can ping exchange.local and get replies from
> the correct IP, and I can telnet exchange.local 25 and see the SMTP
> dialogue.
Yes, but you don’t have DNS entries for them. Exactly what the message
complains about.
As a side note: I see you mention “exchange”. If you are mixing Windows
Active Directory machine with Linux, notice that .local domains may not
work. The workaround is to stop avahi and zeroconf, the real solution is
not to use .local. I use .lnet.
I am not a postfix expert, but my attention was drawn by the above.
It seems that it tries to resolve the name exchange.local to it’s IP address (defined in an AAAA record), but the DNS server has no answer. Now this is in accordance with the fact that you say that you defined that system in /etc/hosts (and thus pobably not in the DNS server you use).
That ping and telnet to the host/domainname work is because they apparently use the /etc/host file (that is, they use a library call that does). Now the question is why postfix doesn’t.
BTW The configuraion that decides what should be searched first is in /etc/nsswitch.conf
Although I have not looked at postfix specifically, it’s been my observation that many programs/services sit squarely on top of the OS with limited or no OS integration. In these cases, the app won’t automatically try options, you need to explicitly configure the option(s). And, this seems to be the case here, plus there might even be some rationale behind it… it could possibly enable name resolution “unpolluted” by wherever and however the machine might be situated which could come in handy.