I have a small home network of just two machines. Machine1 runs Debian Testing with Exim and Procmail. Machine2 is running Mandrake 9 with Postfix.
I have just spent about two half-days trying to set things up so that I can send mail from one machine to another. After having spent hours searching for information on both my own machine and on the Internet I have to admit defeat.
When I try to send mail from a user on either machine to a user on the other I get the following message:
'Host lookup did not complete'
/etc/hosts.conf on both machines:
order hosts,bind multi on
/etc/hosts on machine1: 127.0.0.1 localhost 192.168.1.1 machine1.mynetwork machine1 192.168.1.2 machine2.mynetwork machine2
# The following lines are desirable for IPv6 capable hosts # (added automatically by netbase upgrade)
::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts
Surely it can't be this difficult? I should add that a lot of the information I have read might just as well have been written in Swahili for all the sense it made.
After a very, very, very frustrating 24 hours I can appreciate why some people would give up on Linux and go back to Windows.
Am I missing an important bit of software?
Barry Samuels Professional Defeatist
on Thu, Dec 19, 2002 at 05:51:29PM +0000, bsamuels@beenthere-donethat.org.uk wrote:
When I try to send mail from a user on either machine to a user on the other I get the following message:
'Host lookup did not complete'
...
Am I missing an important bit of software?
perhaps your MTAs cannot find the routes to each other. normally this is done via mx records in a dns zone. with hosts files, you don't get any such records.
with postfix, you can set up transport rules that allow you to bypass (or in your case, simply not use) dns MX records. so for example, you may want on machine2:
machine2.mydomain local: machine1.mydomain smtp:[machine1]
if you plop this in /etc/postfix/transport, then run: # postmap /etc/postfix/transport and add:
transport_maps = hash:/etc/postfix/transport
to /etc/postfix/main.cf. mail to something@machine1.mydomain should work. fingers crossed. this is documented in the transport(5) man page. trivial-rewrite(8) does the work. i use this to change the route of mail to hosts with silly spam protection, to go via another relay host less likely to be rejected.
you may need to force postfix to rehash with a "postfix reload" after a "postfix check" to make sure it's a happy with the config.
exim probably has something similar. qmail does, in the form of smtproutes, iirc.
xs@kittenz.org xs@kittenz.org wrote:
with postfix, you can set up transport rules that allow you to bypass (or in your case, simply not use) dns MX records.
[...]
exim probably has something similar. [...]
Indeed it does. You probably need to make sure that you have a manualroute router working for the hostnames that you want to do that with, else it will probably try to use the dnslookup router which isn't going to work. I speak of Exim 4 here... Exim 3 is actually easier to mangle into doing this by making it do lookups "by_name" instead of "by_dns", IIRC.
I hope that's enough to get you going...
xs@kittenz.org wrote:
perhaps your MTAs cannot find the routes to each other. normally this is done via mx records in a dns zone. with hosts files, you don't get any such records.
with postfix, you can set up transport rules that allow you to bypass (or in your case, simply not use) dns MX records. so for example, you may want on machine2:
machine2.mydomain local: machine1.mydomain smtp:[machine1]
if you plop this in /etc/postfix/transport, then run: # postmap /etc/postfix/transport and add:
transport_maps = hash:/etc/postfix/transport
to /etc/postfix/main.cf. mail to something@machine1.mydomain should work. fingers crossed. this is documented in the transport(5) man page. trivial-rewrite(8) does the work. i use this to change the route of mail to hosts with silly spam protection, to go via another relay host less likely to be rejected.
you may need to force postfix to rehash with a "postfix reload" after a "postfix check" to make sure it's a happy with the config.
exim probably has something similar. qmail does, in the form of smtproutes, iirc.
Followed all your Postfix instructions and I can now send mail from machine2 to machine1. Many thanks for that.
What doesn't work is if I try to send an email from machine2 (Postfix) out to the internet via machine1 (Exim). Is that likely to be a problem with the setup on machine2 or machine1?
I get the following error:
(Name service error for machine1.mynetwork: Host not found, try again) bjsamuels@beenthere-donethat.org.uk
Machine1 is set up as a gateway and machine2 can browse the Web via machine1.
Kind regards
Barry Samuels
on Fri, Dec 20, 2002 at 12:03:22PM +0000, bsamuels@beenthere-donethat.org.uk wrote:
What doesn't work is if I try to send an email from machine2 (Postfix) out to the internet via machine1 (Exim). Is that likely to be a problem with the setup on machine2 or machine1?
it is hard to say. where does this error come from? is machine1 acting as an smtp relay or just an ipv4 gateway? what do the mail logs say about this particular mail? is exim set up to avoid dns mx lookups for itself and machine2?
I get the following error:
(Name service error for machine1.mynetwork: Host not found, try again) bjsamuels@beenthere-donethat.org.uk
bsamuels@beenthere-donethat.org.uk writes:
I have a small home network of just two machines. Machine1 runs Debian Testing with Exim and Procmail. Machine2 is running Mandrake 9 with Postfix.
I have just spent about two half-days trying to set things up so that I can send mail from one machine to another. After having spent hours searching for information on both my own machine and on the Internet I have to admit defeat.
When I try to send mail from a user on either machine to a user on the other I get the following message:
'Host lookup did not complete'
Sounds like a DNS problem to me; make sure that's all working properly before trying to do mail.
I don't know about Exim but some MTAs (and some other applications) do not look at /etc/hosts for some/all DNS lookups (which is hardly surprising given that it's impossible to encode an MX record in a hosts file). For these applications to work you must have your hostnames in DNS as well (or instead).
Richard Kettlewell wrote:
[SNIP]
Sounds like a DNS problem to me; make sure that's all working properly before trying to do mail.
I don't know about Exim but some MTAs (and some other applications) do not look at /etc/hosts for some/all DNS lookups (which is hardly surprising given that it's impossible to encode an MX record in a hosts file). For these applications to work you must have your hostnames in DNS as well (or instead).
If you go the DNS route, I suggest you look at djbdns. Set up dnscache on your internal NIC, and tinydns on 127.0.0.1. That way, dnscache (the resolver) will query tinydns (the name server) for resolution of internal names, and will go to the outside world (direct to the root servers, actually) for anything else. It's not trivial, but it's not so hard either.
Cheers, Laurie.
Laurie Brown laurie@brownowl.com wrote:
If you go the DNS route, I suggest you look at djbdns. [...]
For balance, I suggest you avoid it like the plague. It's not free software and DJB does a "pick and choose" for which bits of the standard he's going to support. A reasonable summary of the competitors and problems are at http://www.weak.org/pipermail/buug/2002-November/001447.html
The most common DNS is bind and it isn't *too* bad these days. I have heard of people are moving to maradns too. If you want a DNS, look at a few and some reviews, then give it a go.