Sending Mail on the LAN (SUSE 8.0)
Well gang, I've got a few boxes running SUSE 8.0 Pro. I would like to be able to send mail between hosts on the LAN, which is not connected to the outside world. The Yast Mail module didn't do anything that I can tell. At leasat I don't get e-mail between hosts. Having viewed the READMEs and other documentation, I think I'm more confused than enlightened. I'm using a hosts file - not a DNS server. (I know that sendmail can use a "well-formed" hosts file.) I have set /etc/sysconfig/mail to SMTP_LISTEN_REMOTE="yes" I have not attempted to generate a custom sendmail.cf file at this point. I have not added any entries to /etc/mail/local-host-names. There is not one example of the format, though I'm guessing I just list all the hosts using FQDN on a separate line. I could be wrong, but I see no examples to follow. The reference manual says to use Yast mail module for configuration. Refer back to my comments above on that note. If I can get 2 boxes e-mailing each other, I'll get the rest up later. I feel like I'm running around in circles, but I'm sure it's all fairly simple. If this is anything at all like ssh, all I had to do was uncomment 2 lines in a file to launch remote X apps. Thanks in advance for any help. -- DC Parris http://matheteuo.org/ http://chaddb.sourceforge.net/ "Free software is like God's love - you can share it with anyone anytime anywhere."
On 15-Oct-04 Don Parris wrote:
Well gang, I've got a few boxes running SUSE 8.0 Pro. I would like to be able to send mail between hosts on the LAN, which is not connected to the outside world. The Yast Mail module didn't do anything that I can tell. At leasat I don't get e-mail between hosts. Having viewed the READMEs and other documentation, I think I'm more confused than enlightened.
I'm using a hosts file - not a DNS server. (I know that sendmail can use a "well-formed" hosts file.)
You may need to probe a bit to get to the bottom of what's wrong. Sendmail should work fine on a LAN (there can be complications if you also mail to the outside world, e.g. via dial-up: you may then need to explicitly despatch the outgoing mail using a modified sendmail.cf file so as to masquerade your sending machine). As a first test, try seeing of you can send mail between your local machines using explicit IP addresses. Suppose (but modifiy the IP addresses to match your local setup) you have three machines whose IP addresses are 192.168.0.1 192.168.0.2 192.168.0.3 and you are sitting at [1] and want to send a message to user "don" at [2]. Then, when entering the "To:" destination address, enter don@[192.168.0.2] (note the square brackets). If it goes through, then sendmail is doing its job and also [2] is accepting SMTP connections. If not, then have a look at /var/log/mail where you should see a comment about what happened to the mail. As a further test of what went wrong in this case, try a manual SMTP dialogue from machine [1] by telnet to port 25 on machine [2], like telnet 192.168.0.2 25 [220-response from remote] ehlo 192.168.0.1 [250-response from remote] mail from: userid@[192.168.0.1] [250-response from remote] rcpt to: don@[192.168.0.2] [250-response from remote] data [354-response from remote] Subject: test message This is a test . [response from remote] at which stage you should see that the message has been accepted for delivery, and it should turn up in don's inbox on [2]. If it fails anywhere along the line, you will get an explicit error message at that stage. In particular, wherever it says "250-response" above you should get a response beginning with "250" which is the SMTP code for "OK, valid so far". As a template for what you should see, here is a complete dialogue between two of my machines: ============================================================
telnet 192.168.0.6 25 Trying 192.168.0.6... Connected to 192.168.0.6. Escape character is '^]'. 220 brandy.fort.knox.uk ESMTP Sendmail 8.11.3/8.11.3/SuSE Linux 8.11.1-0.5; Fri, 15 Oct 2004 10:13:16 +0100 ehlo 192.168.0.7 250-brandy.fort.knox.uk Hello compo.fort.knox.uk [192.168.0.7], pleased to meet you 250-ENHANCEDSTATUSCODES 250-8BITMIME 250-SIZE 250-DSN 250-ONEX 250-ETRN 250-XUSR 250 HELP mail from: ted@[192.168.0.7] 250 2.1.0 ted@[192.168.0.7]... Sender ok rcpt to: ted@[192.168.0.6] 250 2.1.5 ted@[192.168.0.6]... Recipient ok data 354 Enter mail, end with "." on a line by itself Subject: test message
This is a test . 250 2.0.0 i9F9Dm817669 Message accepted for delivery quit 221 2.0.0 brandy.fort.knox.uk closing connection Connection closed by foreign host. ============================================================ Possible system-setting reasons for failure can include security settings on inetd services. You may get "conection refused" on the first line, so that port 25 (SMTP) on [2] is refusing connections. You may get down to the "rcpt to:" line, and then get something like "relaying denied". You may get through the above dialogue and yet the mail does not turn up in don's inbox on [2], in which case while the mail has been accepted by [2], it has not been delivered. This is then a problem with the mail delivery software on [2]. And so on. Anyway, try things out and let us know what happens. Good luck, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding@nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861 [NB: New number!] Date: 15-Oct-04 Time: 10:32:08 ------------------------------ XFMail ------------------------------
(Ted Harding) wrote:
On 15-Oct-04 Don Parris wrote:
Well gang, I've got a few boxes running SUSE 8.0 Pro. I would like to be able to send mail between hosts on the LAN, which is not connected to the outside world. The Yast Mail module didn't do anything that I can tell. At leasat I don't get e-mail between hosts. Having viewed the READMEs and other documentation, I think I'm more confused than enlightened.
I'm using a hosts file - not a DNS server. (I know that sendmail can use a "well-formed" hosts file.)
You may need to probe a bit to get to the bottom of what's wrong. Sendmail should work fine on a LAN (there can be complications if you also mail to the outside world, e.g. via dial-up: you may then need to explicitly despatch the outgoing mail using a modified sendmail.cf file so as to masquerade your sending machine).
As a first test, try seeing of you can send mail between your local machines using explicit IP addresses.
Suppose (but modifiy the IP addresses to match your local setup) you have three machines whose IP addresses are
192.168.0.1 192.168.0.2 192.168.0.3
and you are sitting at [1] and want to send a message to user "don" at [2]. Then, when entering the "To:" destination address, enter
don@[192.168.0.2]
(note the square brackets). If it goes through, then sendmail is doing its job and also [2] is accepting SMTP connections.
Well, I hadn't though of using the IP address (and wouldn't have known to add the brackets, either). Anyway, that works. /var/log/mail shows a hostname lookup failure where I used the domain name instead. So how do I use the domain name instead of the IP addresses? Is this where I need to add the host names in /etc/mail/local-host-names? -- DC Parris http://matheteuo.org/ http://chaddb.sourceforge.net/ "Free software is like God's love - you can share it with anyone anytime anywhere."
On 15-Oct-04 Don Parris wrote:
(Ted Harding) wrote:
On 15-Oct-04 Don Parris wrote:
[...] I'm using a hosts file - not a DNS server. (I know that sendmail can use a "well-formed" hosts file.)
[...] As a first test, try seeing of you can send mail between your local machines using explicit IP addresses.
Suppose (but modifiy the IP addresses to match your local setup) you have three machines whose IP addresses are
192.168.0.1 192.168.0.2 192.168.0.3
and you are sitting at [1] and want to send a message to user "don" at [2]. Then, when entering the "To:" destination address, enter
don@[192.168.0.2]
(note the square brackets). If it goes through, then sendmail is doing its job and also [2] is accepting SMTP connections.
Well, I hadn't though of using the IP address (and wouldn't have known to add the brackets, either). Anyway, that works. /var/log/mail shows a hostname lookup failure where I used the domain name instead. So how do I use the domain name instead of the IP addresses? Is this where I need to add the host names in /etc/mail/local-host-names?
I'd suggest setting these in the /etc/hosts file which should look like 127.0.0.1 localhost lh 192.168.0.1 mach1.dons.dom.ain mach1 m1 192.168.0.2 mach2.dons.dom.ain mach2 m2 192.168.0.3 mach3.dons.dom.ain mach3 m3 and so on. Also, make sure that in /etc/host.conf you have the lines order hosts bind multi on Your machine should then look up name-to-IP translations by first looking in /etc/hosts and only then, if this fails, by attempting to find another nameserver in /etc/resolv.conf *Note* that /etc/host.conf can get re-written by SuSEConfig. In /etc/hosts, the first field is of course the IP address of a machine, the second is its full name (FQDN), and the rest are abbreviations ("nicknames") which you should be able to use locally. E.g. telnet m2 should initiate a telnet connection to 192.168.0.2 (I'm a bit of a freak for very short names. For instance, I've made an alias "tl" for "telnet", so "tl lh" is a telnet to localhost. Likewise, I have a nickname "ns" in /etc/hosts for my external mail host nessie.mcc.ac.uk, so when online I can do "tl ns". Etc.) Hoping this breaks the final barrier! Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding@nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861 [NB: New number!] Date: 15-Oct-04 Time: 18:05:28 ------------------------------ XFMail ------------------------------
(Ted Harding) wrote:
<SNIP>
I'd suggest setting these in the /etc/hosts file which should look like
127.0.0.1 localhost lh 192.168.0.1 mach1.dons.dom.ain mach1 m1 192.168.0.2 mach2.dons.dom.ain mach2 m2 192.168.0.3 mach3.dons.dom.ain mach3 m3
and so on.
My hosts file looks more like: 127.0.0.1 localhost lh 192.168.0.1 mach1.dom.ain mach1 192.168.0.2 mach2.dom.ain mach2 192.168.0.3 mach3.dom.ain mach3 My /etc/hosts.conf is the same. I am attempting to send e-mail as - To: user2@mach2.dom.ain And therein is where my problem likely lies. I need to rename the domain, so that the domain name is something like dons.dom.ain, instead of dom.ain. Would that be correct? Don
Also, make sure that in /etc/host.conf you have the lines
order hosts bind multi on
Your machine should then look up name-to-IP translations by first looking in /etc/hosts and only then, if this fails, by attempting to find another nameserver in /etc/resolv.conf
*Note* that /etc/host.conf can get re-written by SuSEConfig.
In /etc/hosts, the first field is of course the IP address of a machine, the second is its full name (FQDN), and the rest are abbreviations ("nicknames") which you should be able to use locally.
E.g.
telnet m2
should initiate a telnet connection to 192.168.0.2
(I'm a bit of a freak for very short names. For instance, I've made an alias "tl" for "telnet", so "tl lh" is a telnet to localhost. Likewise, I have a nickname "ns" in /etc/hosts for my external mail host nessie.mcc.ac.uk, so when online I can do "tl ns". Etc.)
Hoping this breaks the final barrier! Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding@nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861 [NB: New number!] Date: 15-Oct-04 Time: 18:05:28 ------------------------------ XFMail ------------------------------
-- DC Parris http://matheteuo.org/ http://chaddb.sourceforge.net/ "Free software is like God's love - you can share it with anyone anytime anywhere."
On 16-Oct-04 Don Parris wrote:
(Ted Harding) wrote:
I'd suggest setting these in the /etc/hosts file which should look like
127.0.0.1 localhost lh 192.168.0.1 mach1.dons.dom.ain mach1 m1 192.168.0.2 mach2.dons.dom.ain mach2 m2 192.168.0.3 mach3.dons.dom.ain mach3 m3
and so on.
My hosts file looks more like:
127.0.0.1 localhost lh 192.168.0.1 mach1.dom.ain mach1 192.168.0.2 mach2.dom.ain mach2 192.168.0.3 mach3.dom.ain mach3
My /etc/hosts.conf is the same.
I am attempting to send e-mail as - To: user2@mach2.dom.ain
And therein is where my problem likely lies. I need to rename the domain, so that the domain name is something like dons.dom.ain, instead of dom.ain. Would that be correct?
I don't think there should be a problem about the number of components in your machine names so long as there are at least two: one for the individual machine (the first) and the rest to designate the domain that the different machines belong to. When you wrote "/etc/hosts.conf", was this correct? This is not a standard file in the DNS system. There is (or should be) a file "/etc/host.conf". However, if /etc/host.conf is what you meant, then I'm concerned that you say this "is the same" (?as /etc/hosts?). On my machines, /etc/host.conf contains only the single line order hosts,bind with (on some machines) also the line multi on You might also have a line or lines beginning with the keyword trim where you would indeed have a domain name, e.g. trim .dom.ain intended to cause this to be stripped from FQDNs so that mach1.dom.ain would be seen as mach1 on the local net. However, this doesn't seem to be neccessary (I've never had such a line) and provided your /etc/hosts file contains the IP addresses for all your local machines you should be OK. See 'man host.conf' for fuller explanations of what can go in this file. Another thing to check is that all your machines have consistent /etc/hosts and /etc/host.conf files. When you send mail from [1] to [2], [2] may carry out a "reverse DNS lookup" on the "From: " address in the mail, in order to check that the mail is coming from a valid source (anti-spoofing and anti-relay precaution). If [2] can't find [1]'s IP address in its /etc/hosts (or however it looks it up) then you could get mail rejected. So each machine you mail from would need to be findable by each machine on your LAN that you mail to. However, this probably doesn't apply in your case since apparently you can mail to an IP address. So it's more likely to be a case of destination machine-name not translating to IP address on the sending machine. Good luck again! Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding@nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861 [NB: New number!] Date: 16-Oct-04 Time: 12:21:03 ------------------------------ XFMail ------------------------------
(Ted Harding) wrote:
On 16-Oct-04 Don Parris wrote:
(Ted Harding) wrote:
I'd suggest setting these in the /etc/hosts file which should look like
127.0.0.1 localhost lh 192.168.0.1 mach1.dons.dom.ain mach1 m1 192.168.0.2 mach2.dons.dom.ain mach2 m2 192.168.0.3 mach3.dons.dom.ain mach3 m3
and so on.
My hosts file looks more like:
127.0.0.1 localhost lh 192.168.0.1 mach1.dom.ain mach1 192.168.0.2 mach2.dom.ain mach2 192.168.0.3 mach3.dom.ain mach3
My /etc/hosts.conf is the same.
I am attempting to send e-mail as - To: user2@mach2.dom.ain
And therein is where my problem likely lies. I need to rename the domain, so that the domain name is something like dons.dom.ain, instead of dom.ain. Would that be correct?
I don't think there should be a problem about the number of components in your machine names so long as there are at least two: one for the individual machine (the first) and the rest to designate the domain that the different machines belong to.
When you wrote "/etc/hosts.conf", was this correct? This is not a standard file in the DNS system. There is (or should be) a file "/etc/host.conf". However, if /etc/host.conf is what you meant, then I'm concerned that you say this "is the same" (?as /etc/hosts?).
Sorry about that. I meant /etc/hosts. Not sure why I put the ".conf" in there. I have changed my hosts file to match your scheme. The host.conf file is correctly configured (same as what you suggested).
/etc/hosts and /etc/host.conf files. When you send mail from [1] to [2], [2] may carry out a "reverse DNS lookup" on the "From: " address in the mail, in order to check that the mail is coming from a valid source (anti-spoofing and anti-relay precaution). If [2] can't find [1]'s IP address in its /etc/hosts (or however it looks it up) then you could get mail rejected. So each machine you mail from would need to be findable by each machine on your LAN that you mail to.
However, this probably doesn't apply in your case since apparently you can mail to an IP address. So it's more likely to be a case of destination machine-name not translating to IP address on the sending machine.
I'll nose around some more. -- DC Parris http://matheteuo.org/ http://chaddb.sourceforge.net/ "Free software is like God's love - you can share it with anyone anytime anywhere."
lördag 16 oktober 2004 06:02 skrev Don Parris:
And therein is where my problem likely lies. I need to rename the domain, so that the domain name is something like dons.dom.ain, instead of dom.ain. Would that be correct?
The simplest way, is to have one machine as the smtp relay host. It handles email for domain dom.ain. All other machines within the domain, relay their email through this machine. So, you send your email to user2@dom.ain. Next thing to do, is to have the mail host, store these mail for the local user, then export /var/spool/mail ... and have all other machines remote mount it through nfs.
By the way, Ted, I'm seeing double when you post. When you post, a duplicate accompanies your original for some odd reason (both have same timestamp). I assume you're seeing the same thing. Just thought you might want to look into it. ;) -- DC Parris http://matheteuo.org/ http://chaddb.sourceforge.net/ "Free software is like God's love - you can share it with anyone anytime anywhere."
Don, On Friday 15 October 2004 21:16, Don Parris wrote:
By the way, Ted, I'm seeing double when you post. When you post, a duplicate accompanies your original for some odd reason (both have same timestamp). I assume you're seeing the same thing. Just thought you might want to look into it. ;)
That's surely because he's sending one copy to the SuSE-Linux-E list and one directly to you (check the headers). We out here see only one post from Ted.
-- DC Parris
Randall Schulz
Don,
On Friday 15 October 2004 21:16, Don Parris wrote:
By the way, Ted, I'm seeing double when you post. When you post, a duplicate accompanies your original for some odd reason (both have same timestamp). I assume you're seeing the same thing. Just thought you might want to look into it. ;)
That's surely because he's sending one copy to the SuSE-Linux-E list and one directly to you (check the headers). We out here see only one post from Ted.
Oops - sorry Randall: replied to the poster by mistake (again) Anyway, sometimes, this can be due to a duplicated filter in the mail client. David
On Fri, 2004-10-15 at 23:16, Don Parris wrote:
By the way, Ted, I'm seeing double when you post. When you post, a duplicate accompanies your original for some odd reason (both have same timestamp). I assume you're seeing the same thing. Just thought you might want to look into it. ;)
-- DC Parris http://matheteuo.org/ http://chaddb.sourceforge.net/ "Free software is like God's love - you can share it with anyone anytime anywhere."
I'm not seeing any dupes here Don. Mike
Mike McMullin wrote:
On Fri, 2004-10-15 at 23:16, Don Parris wrote:
By the way, Ted, I'm seeing double when you post. When you post, a duplicate accompanies your original for some odd reason (both have same timestamp). I assume you're seeing the same thing. Just thought you might want to look into it. ;)
-- DC Parris http://matheteuo.org/ http://chaddb.sourceforge.net/ "Free software is like God's love - you can share it with anyone anytime anywhere."
I'm not seeing any dupes here Don.
Mike
Yeah, I'm just getting a carbon copy. No biggie, just thought I'd point it out. Y'all know I accidentally do that sometimes myself. -- DC Parris http://matheteuo.org/ http://chaddb.sourceforge.net/ "Free software is like God's love - you can share it with anyone anytime anywhere."
On 16-Oct-04 Mike McMullin wrote:
On Fri, 2004-10-15 at 23:16, Don Parris wrote:
By the way, Ted, I'm seeing double when you post. When you post, a duplicate accompanies your original for some odd reason (both have same timestamp). I assume you're seeing the same thing. Just thought you might want to look into it. ;)
I'm not seeing any dupes here Don.
Sorry! I had replied to Don and Cc:'d to the list. Hence Don sees two, the rest see one. Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding@nessie.mcc.ac.uk> Fax-to-email: +44 (0)870 094 0861 [NB: New number!] Date: 16-Oct-04 Time: 11:42:53 ------------------------------ XFMail ------------------------------
participants (6)
-
David Robertson
-
Don Parris
-
Mike McMullin
-
Randall R Schulz
-
Ted.Harding@nessie.mcc.ac.uk
-
Örn Hansen