Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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!
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.
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?
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
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.
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.
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?
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.
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>
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
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.
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.