LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-22-2007, 07:26 AM   #1
krnlcrash
LQ Newbie
 
Registered: Dec 2005
Distribution: Mandrake 10.1
Posts: 17

Rep: Reputation: 0
sendmail woes


This is probably a dumb question to most of you but being a noob and not getting satisfaction from my google searches brings me here.

I can't get sendmail to send mail. This should be fairly simple as I'm not doing anything fancy, I just want to send mail from my server (local) and not relay anyone (yet). I followed the tutorial here: http://www.linuxjournal.com/article/5507 but after following all the steps, the server isn't giving me any love.

This may be due to the fact the tutorial is for an older version of sendmail as some of the files didn't exist and variables that need to be set are in different places.

Using:
sendmail Version 8.13.4
procmail v3.22

I don't think this is a firewall issue since this is outgoing (but I suppose I could be wrong).

Being very noob I'm not even sure where to start looking to debug this. /var/log/messages gives me the following every time I try to send:

Feb 22 13:26:19 intermobil CROND[29881]: (root) MAIL (mailed 1089 bytes of output but got status 0xffffffff )

When running mail -v someone@domain.com
I get sendmail trying to: Connecting to localhost.info. via relay...

Why is sendmail trying to connect to localhost.info? What can I change so it can either connect to an IP address or simply to localhost???

any help would be appreciated.
 
Old 02-22-2007, 10:03 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Check your /etc/mail/sendmail.cf and see if you have an uncommented line that starts with "DS". If there is anything after that DS on the line it is using that as your "Smart Relay" host. If you don't recognize the host then either delete it or comment it out and create an uncommented line that starts with the "DS" but has no host specified. That will make it do all mail "locally" and it will open smtp to domains that aren't local rather than trying to relay through another host.
 
Old 02-22-2007, 10:41 AM   #3
krnlcrash
LQ Newbie
 
Registered: Dec 2005
Distribution: Mandrake 10.1
Posts: 17

Original Poster
Rep: Reputation: 0
I checked the file and no host specified.
 
Old 02-22-2007, 10:57 AM   #4
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Make sure the first uncommented line in your /etc/hosts file is for 127.0.0.1 for localhost.

Make sure that either that line has your real FQDN (host name with domain) or that the line just below it has your real IP and the FQDN.

Also check to see if the sendmail daemon is running. "ps -ef |grep sendmail". If not try running "/etc/init.d/sendmail start".
 
Old 02-22-2007, 12:09 PM   #5
krnlcrash
LQ Newbie
 
Registered: Dec 2005
Distribution: Mandrake 10.1
Posts: 17

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jlightner
Make sure the first uncommented line in your /etc/hosts file is for 127.0.0.1 for localhost.
Check. Changed this and restarted sendmail. Still looking for relay host localhost.info

Quote:
Originally Posted by jlightner
Make sure that either that line has your real FQDN (host name with domain) or that the line just below it has your real IP and the FQDN.
Check. Added real IP of my host and hostname. No change, still looking for localhost.info


Quote:
Originally Posted by jlightner
Also check to see if the sendmail daemon is running. "ps -ef |grep sendmail". If not try running "/etc/init.d/sendmail start".
Check. Running:
ps -ef |grep sendmail
root 4417 1 0 20:09 ? 00:00:00 sendmail: accepting connections
mail 4432 1 0 20:09 ? 00:00:00 sendmail: Queue runner@01:00:00 for var/spool/clientmqueue
mail 4433 4432 0 20:09 ? 00:00:00 sendmail: ./l1MHU0tu003771 localhost.info.: user open
mail 4441 4440 0 20:09 pts/3 00:00:00 sendmail: ./l1MI9tUT004441 localhost.info.: user open
mail 4470 4446 0 20:10 ? 00:00:00 sendmail: ./l1MIA0xQ004470 localhost.info.: user open
mail 4471 4444 0 20:10 ? 00:00:00 sendmail: ./l1MIA0Gc004471 localhost.info.: user open
root 4494 31881 0 20:10 pts/5 00:00:00 grep sendmail


I even tried to trick it and added localhost.info to the /etc/hosts file and assigned it 127.0.0.1 address. That didn't seem to work either
 
Old 02-22-2007, 12:36 PM   #6
Pete M
Member
 
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 32
krnlcrash

You have started on a very long quest trying to understand Sendmail

Take a look at this tutorial, it's a lot more up to date

http://www.linuxhomenetworking.com/w...x_Mail_Servers

Hope you like reading

Peter
 
Old 02-23-2007, 06:46 AM   #7
krnlcrash
LQ Newbie
 
Registered: Dec 2005
Distribution: Mandrake 10.1
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks Pete,

I'll definately have to read through that. A new peice to the puzzle came up today. On startup, it seems the server sends all the e-mails that I sent earlier. So perhaps I'm seeing a conflict somewhere?

I have mysql running and a radius server and a host of other services most likely that don't ocme to mind. What commands should I run to check if some port is being highjacked that sendmail needs?

Last edited by krnlcrash; 02-23-2007 at 07:20 AM.
 
Old 02-23-2007, 09:12 AM   #8
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
sendmail uses port 25 for smtp.

lsof -i :25
Would show you any process that is using port 25.

It probably wasn't hijacked but just hosed up. The reboot cleared it for you.

If you're not using this sendmail server to ACCEPT connections from others (i.e. all the email is generated from within the box sendmail is running on) then you can modify iptables so that it rejects incoming requests for port 25 and just allow it on the local host (127.0.0.1) IP.
 
Old 02-23-2007, 10:30 AM   #9
krnlcrash
LQ Newbie
 
Registered: Dec 2005
Distribution: Mandrake 10.1
Posts: 17

Original Poster
Rep: Reputation: 0
nice command. Output looks as expected:

lsof -i :25
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
sendmail. 6442 root 4u IPv4 51155 TCP *:smtp (LISTEN)
sendmail 8899 mail 6u IPv6 169328 TCP 192.168.0.10:46013->69.25.142.22:smtp (SYN_SENT)
sendmail 8900 mail 6u IPv6 169330 TCP 192.168.0.10:46014->69.25.142.22:smtp (SYN_SENT)
 
Old 02-23-2007, 12:37 PM   #10
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Yep. lsof is a great utility. Works better than fuser for finding open files and better than netstat for finding open ports and connections to other servers. (Well actually the netstat on Linux will show you processes associated with open ports - but on UNIX it doesn't so you have to use lsof.)

It's also nice for its main purpose - listing open file handles.

It has a thousand uses - it's like the swiss army knife of admin utilities.

Moreover, it's author, Vic Abell, was very responsive and has spent a lot of his time working with HP when I pointed out an issue introduced by them in HP-UX 11.11. The issue was theirs rather than his but he didn't just drop it like some would have.
 
  


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
Sendmail Spam / Upgrade woes marcusmiller Linux - Software 1 08-03-2005 07:03 AM
Sendmail woes caps_phisto Linux - Networking 4 12-30-2004 06:33 AM
sendmail woes dkw Linux - Networking 3 07-28-2004 03:40 AM
sendmail woes. nikhil93 Linux - General 2 03-29-2004 02:06 PM
Sendmail Woes! rkane Slackware 14 06-04-2003 07:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:55 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