LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-03-2003, 07:09 PM   #1
pilot1
Member
 
Registered: Jun 2002
Location: USA
Distribution: Gentoo, Fedora Core
Posts: 408

Rep: Reputation: 30
Question Sending email to other computers on LAN


I'm using sendmail (I have no idea what version, how do you tell? I tried "sendmail --version", but that didn't work. And I did a "man sendmail | grep version" and it didn't come up with anything.) The computer is running RedHat 7.2, with kernel 2.4.21.

I want to be able to send email from the computer with IP address 192.168.1.102 to the user andrew on the computer with IP address 192.168.1.101.
How can I do this? I'm using sendmail on 102, and postfix on 101..
Thanks!
 
Old 08-03-2003, 07:29 PM   #2
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
Sendmail is an MTA (Mail Transfer Agent) not an MUA (Mail User Agent).

So a user does not invoke sendmail to invoke and compose messages; the users users a program like mail, MH, pine, mutt, Netscrape mail etc to compose mail messages.

Simplest and quickest method

mail -s "test message from 192.168.1.102" andrew@192.168.1.101
Hello Andrew,
This is a test message.
Love, pilot1 xox
.
^ a period at beginning of line all by itself followed by <CR>

You can even send files simply and easily in one go with

mail -s "file: /etc/hosts" user@host < /etc/hosts

The message is then passed by the "mail" program to sendmail which then
talks SMTP to the mailer on 192.168.1.101, which happens to be postfix,
which then puts the message in /var/spool/mail/andrew.

The user andrew invokes the mail program which by default looks for a file in /var/spool/mail$USER.

This all pre-supposes that the sendmail and postfix programs are installed, configured (out of the box configuration should be just fine though) and that they are either running as standalone daemons or invoked through inetd or xinetd.
 
Old 08-04-2003, 07:13 AM   #3
pilot1
Member
 
Registered: Jun 2002
Location: USA
Distribution: Gentoo, Fedora Core
Posts: 408

Original Poster
Rep: Reputation: 30
When I try to send it I get an email with subject "Mail delivery failed" on the computer I try to send it from. The error number is "550: Host unknown".
Postfix or sendmail must be configure incorrectly, but this is the out-of-the-box configuration.
Any idea what I need to change?
 
Old 08-04-2003, 07:16 AM   #4
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
The reason why you are getting the error message is because the installed configuration of sendmail has been set to deny addresses with IP numbers.

May I ask why you are insisting on using IP numbers and not just using the hostname?
 
Old 08-04-2003, 03:45 PM   #5
pilot1
Member
 
Registered: Jun 2002
Location: USA
Distribution: Gentoo, Fedora Core
Posts: 408

Original Poster
Rep: Reputation: 30
I can use hostnames too, in fact it would be easier to.
I just assumed it would simplify things if I just used the IP address until I got it working, but I guess that isn't the case.

When I try to send it I get an error, output below.

[root@user-0cej37o root]# mail -s andrew@zeus "Testmsg2"
2
.
Cc:
[root@user-0cej37o root]# Testmsg2... User unknown
/root/dead.letter... Saved message in /root/dead.letter
 
Old 08-04-2003, 04:36 PM   #6
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
Quote:
Originally posted by pilot1
I can use hostnames too, in fact it would be easier to.
I just assumed it would simplify things if I just used the IP address until I got it working, but I guess that isn't the case.
Back in the stone age days of when administrators were slow in setting up DNS it was the only way to get messages sent, but nowadays as a security feature to prevent abuse and spamming of sendmail, the support for IP addresses has been turned off by default.

Quote:

When I try to send it I get an error, output below.

[root@user-0cej37o root]# mail -s andrew@zeus "Testmsg2"
2
.
Cc:
[root@user-0cej37o root]# Testmsg2... User unknown
/root/dead.letter... Saved message in /root/dead.letter
That is because you have tried to sent mail to user Testmsg2. What you have forgotten to do is to include the redirection symbol < (less than). And you have also specified andrew@zeus as being the subject of the message, because you forgot to include the subject field.

So please try again with

mail -s "test from user-0cej37o" andrew@zeus < Testmsg2

without omitting the double quotes or the less than sign.

I trust that Testmsg2 exists as a file in the current directory.

And do not forget to

rm -iv /root/dead.letter

Last edited by Corin; 08-04-2003 at 04:38 PM.
 
Old 08-04-2003, 04:46 PM   #7
pilot1
Member
 
Registered: Jun 2002
Location: USA
Distribution: Gentoo, Fedora Core
Posts: 408

Original Poster
Rep: Reputation: 30
Ohh, I misread your previous post.
I tried it with the command you gave - it appeared to send but I didn't recieve it on the computer it should of sent to.
 
Old 08-04-2003, 07:44 PM   #8
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
So the computer you think is called zeus is not called zeus at all,
or sendmail thinks another computer which is not called zeus is
called zeus?

Of course it is possible that sendmail has been configure so that
all mail which is addressed to zeus (or even a particular user
on zeus) is sent to an address on another machine.

Are you the adminstrator for sendmail or the machine zeus?
 
Old 08-04-2003, 07:48 PM   #9
pilot1
Member
 
Registered: Jun 2002
Location: USA
Distribution: Gentoo, Fedora Core
Posts: 408

Original Poster
Rep: Reputation: 30
This is my home LAN, so i'm the administrator for everything.
zeus is set up in /etc/hosts, would that prevent it from working correctly?

The reason I want to do this is so that I can send my Logsentry/Logwatch logs to zeus, instead of having to SSH into pandora (192.168.1.102) and read them through pine/mutt/whatever.
 
Old 08-04-2003, 08:10 PM   #10
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
Hi Andrew,

So you have the machines

zeus 192.168.1.101
pandora 192.168.1.102

(I like the classical Greek names btw)

and you have sendmail running on pandora and you want to send e-mail from pandora to zeus?

Having entries for zeus and pandora in /etc/hosts is not a bad thing
at all, and if you do not have DNS setup, then it is essential.

1) So the thing I need to know is, when you send the test message,
and you say that it did not arrive on the correct machine, which
machine did I arrive on?

2) If you do the following test on pandora

sendmail -v andrew@zeus
test
.
^ A period at the beginning of the line followed by <CR>

what is the output?
 
Old 08-05-2003, 06:04 AM   #11
pilot1
Member
 
Registered: Jun 2002
Location: USA
Distribution: Gentoo, Fedora Core
Posts: 408

Original Poster
Rep: Reputation: 30
1) It didn't arrive on any machine, yet it appeared to send correctly and I didn't recieve any errors after sending it. I'm trying to send it from pandora (which is running RH 7.2 and sendmail) to zeus (which is running RH 9 and postfix).

2) Here's the output. pandora is connected to the WAN on eth0, and the LAN on eth1. Maybe it's trying to send it through the WAN (user-....) instead of the LAN?


[root@user-0cej37o root]# sendmail -v andrew@zeus
WARNING: local host name (user-0cej37o) is not qualified; fix $j in config file
test
.
andrew@zeus... Connecting to zeus.earthlink.net. via esmtp...
andrew@zeus... Deferred: Connection refused by zeus

Last edited by pilot1; 08-05-2003 at 06:05 AM.
 
Old 08-05-2003, 08:54 AM   #12
Corin
Member
 
Registered: Jul 2003
Location: Jette, Brussels Hoofstedelijk Gewest
Distribution: Debian sid, RedHat 9, Suse 8.2
Posts: 446

Rep: Reputation: 31
Hi Andrew!

Quote:
Originally posted by pilot1
yet it appeared to send correctly
It tried to send it, but zeus refused. You must read what it is telling you.

Quote:
[root@user-0cej37o root]# sendmail -v andrew@zeus
WARNING: local host name (user-0cej37o) is not qualified; fix $j in config file
test
.
andrew@zeus... Connecting to zeus.earthlink.net. via esmtp...
andrew@zeus... Deferred: Connection refused by zeus
Can you not see the problem immediately from the above messages?

The hostname on pandora is not set to pandora at all but to user-0cej370. What is in your file /etc/HOSTNAME ?

Why does your machine have this name when you said that its name was pandora?

You also have not set up your domain name correctly.

sendmail does try to connect to zeus.earthlink.net, but is that zeus your local machine? Is your zeus in the domain earthlink.net?

And if it is, your postfix on zeus is not configured correctly to accept incoming mail from machine user-0cej370.

So all in all, you have not properly configured your local network.

So it is time for back to basics, and proper network configuation, before trying to send mail.

Last edited by Corin; 08-05-2003 at 08:55 AM.
 
Old 08-05-2003, 10:22 AM   #13
pilot1
Member
 
Registered: Jun 2002
Location: USA
Distribution: Gentoo, Fedora Core
Posts: 408

Original Poster
Rep: Reputation: 30
I completely forgot that I had changed the hostname on that computer.. it used to be pandora, but once it became my firewall DHCP changed it.
zeus is in that domain, and postfixt probably isn't configured correctly.
I'll fix it, thanks.
 
Old 08-05-2003, 12:04 PM   #14
softgun
Member
 
Registered: Jun 2003
Posts: 119

Rep: Reputation: 15
I would like to setup email in a LAN as well. What must i have in the machines? Must all have send mail? Can't all clients send to a server and everyone can read from there? Can squirrelmail be setup in a LAN?
 
Old 08-05-2003, 01:08 PM   #15
sopiaz57
Member
 
Registered: Apr 2003
Distribution: RH 8
Posts: 246

Rep: Reputation: 30
or you could just telnet localhost (or ur hostname) to port 25 and talk SMTP yourself, it's simple.....


after connecting type helo "your hostname"
then rcpt to "person ur sending to"



all the rest look up on google, i forget offhand but i remember a "." terminates.

cya
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Downloading from pop server then sending to computers within my network shmore Linux - Networking 1 01-31-2005 01:35 PM
Downloading from pop server then sending to computers within my network shmore Linux - Software 1 01-30-2005 04:54 PM
KDE Lan Browser doesn't display available LAN computers dance2die Linux - Newbie 2 01-16-2005 08:14 PM
Small LAN, email btwn computers mattp Linux - Networking 1 03-14-2004 08:55 PM
sending an email to a email address after a perl operation meluser Programming 9 04-07-2003 01:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration