Sendmail configuration Help  (Red Hat 8.0)

Vision
Vision used Ask the Experts™
on
I installed Red Hat 8.0 on a intel box.  I'm not overly familar with Red Hat (I've used slackware distributions in the past).
Anyways, I seem to have run into the problem that I cannot send mail.

I run this command:
/usr/sbin/sendmail -v username < data.txt
and I get this out:
username... Connecting to [localhost] via relay...

I probably just have not configured my sendmail.cf (or similar file) correctly, but the docs aren't helping me much and I don't have time to really investigate it for long periods of time.

Any help is appreciated.
-Vision
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2005
Commented:
Does the system have a localhost entry in /etc/hosts? If the system has a static IP hosts should look like:

127.0.0.1   localhost.localdomain localhost
1.2.3.4     my-box.my-domain.tld my-box

Note that sendmail "out of the box" on RH 8.0 won't accept connections to the SMTP port from outside. It will accept connections from the localhost IP. You can change that by editing /etc/mail/sendmail.mc and commenting out the line that reads:

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')

then rebuild the sendmail.cf with:

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

and restart sendmail (service sendmail restart).

Author

Commented:
You had a very well though out comment.  It looks like my Sendmail server wasn't started (I'm not sure why) and so when I went through to issue the 'sendmail restart' command it failed the stop, but came up okay.  It then worked as intended.
Now I'm left with a few other problems (that I'll probably end up asking in another thread).  Like my root mail is going to a user account (one & the same) and it took about 5 minutes for my sendmail to activate.  Which seems like a long time.
Anyways, the M4 command & the fact that localhost should be in my hosts file (127.0.0.1 was there but not labeled at local host) were good information.
Thanks again.
-Vision
Top Expert 2005

Commented:
If it is taking sendmail a while to start, that probably means that the hostname of the system doesn't look like a Fully Qualified Domain Name (FQDN) and that a reverse lookup of the IP of the machine doesn't return an FQDN.

Sendmail must see a hostname that contains at least one '.', which it takes to be an FQDN. If the hostname doesn't look like an FQDN, and DNS is enabled, it will try to find out what the FQDN is by doing a reverse lookup on the IP that it is listening on. If the DNS that the system is configured to use doesn't have a PTR record for the IP you have to wait for the request to time out (typically 120 seconds or a multiple thereof).

The solution to this is simple, either add a PTR record in the DNS, or make sure that 'hostname' returns something with at least one '.'.

I'm not sure what you mean by "root mail is going to a user account (one & the same)". In a stock 8.0 installation the aliases file doesn't re-direct root's mail anywhere. You can change that by editing /etc/aliases and changing:

# Person who should get root's mail
#root:          marc

to something like:

# Person who should get root's mail
root:          some-user

Then run newaliases to update the map.
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

Author

Commented:
I'm going to go ahead and move this to a new question so someone can get some point for it:
Here is the new address:
<a href=http://www.experts-exchange.com/Networking/Linux_Networking/Q_20401383.html>http://www.experts-exchange.com/Networking/Linux_Networking/Q_20401383.html</a>
-Vision

Author

Commented:

Author

Commented:
Oh, one last thing if I might, how do I (from the command line) get Sendmail to start-up automatically?
Top Expert 2005

Commented:
You need to enable the service and that's easily done with:

chkconfig sendmail on

Also you can see what services are available and what their status is with:

chkconfig --list

Author

Commented:
Cool thanks, is it odd that the only thing listed is sendmail?  ie.
[root@mycomp root]# /sbin/chkconfig sendmail --list
sendmail        0:off   1:off   2:on    3:on    4:on    5:on    6:off

That's all that was listed.
But thank you for that effort, I'll put extra points into the next question you answer for this one.
Top Expert 2005

Commented:
With that command you asked chkconfig to list the status of only sendmail. Try:

chkconfig --list

Author

Commented:
Smaks head with palm!  Duh!  I can't believe I over looked that.  (Hangs head in shame).  Thanks for pointing that out.
-Vision

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial