Solved

Trying to setup sendmail on my RH 9 server

Posted on 2003-12-01
4
681 Views
Last Modified: 2010-04-21
I am a newbie to sendmail.  I have a server running redhat that I now want to make my smtp server for 5 machines on my local network to use as their smtp server.  I've enabled the sendmail service and verified that it is running.  I can telnet to it on port 25 from the console, but I can not telnet to it from another server.

The server has full access to the internet and can resolve hostnames.

To test it, I configured outlook on a workstation and told it to use mail.mydomain.com as the smtp server.  When I try to send mail, I get the following error: "unable to connect to the server".

What am I missing here.
0
Comment
Question by:conoverc73
4 Comments
 
LVL 3

Expert Comment

by:UkWizard
ID: 9854302
There is two possibilities here, either you have a firewall running, or the sendmail is not listening on the IP address.

Run the following commands;

# netstat -l |grep smtp
look for the line(s) that say either *:smtp   or servername:smtp, this will tell you if the sendmail is listening on all IP addresses or just the servernames ip address. from the linux box, telnet to this servername for the smtp port.

What happens ?

Check that the firewall isnt blocking it, quickest way is to stop the firewall temporarily using the following command;

# service ipchains stop

then try again, let me know what the findings are if youre still stuck.
0
 
LVL 24

Accepted Solution

by:
shivsa earned 125 total points
ID: 9854397
By default RH used to have inbound access to sendmail blocked.  it only listen to localhost which is 127.0.0.1.
Look at the Release notes on the 1st CD and you'll see what needs to be done to enable inbound connections to sendmail.

anyway here is the solution if u do not want to read the notes. i would recommend anyway.
-----------------------------
The way to make it work is to edit the /etc/sendmail.cf file and look for the line:

O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA

and put a "#" symbol in front of it to comment it out so it will go back to default listing on all available network interfaces.

Alternatively, you could change/add the "Addr=127.0.0.1" option to be the IP address of your Linux server.

Then restart sendmail using "/etc/init.d/sendmail restart" to have it re-read the sendmail.cf file to make the change active
0
 
LVL 12

Assisted Solution

by:paullamhkg
paullamhkg earned 125 total points
ID: 9854836
also in your /etc/hosts.allow, try add "sendmail : allow"

and in the /etc/mail/access

[root@test mail]# more access
# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#
# by default we allow relaying from localhost...
yourdomain.com                      RELAY                          <---- this will allow your domain to relay with the server
192.168.0                               RELAY                           <---- this will allow your subnet to relay

so after you add the data into "access" you have to put the data into your access.db just run "makemap hash access.db < access" with do.

check your sendmail.cf  there is a line as below

#####  $Id: accept_unresolvable_domains.m4,v 8.10 1999/02/07 07:26:07 gshapiro E
xp $  #####
Cwyourdomain.com

you have to add your domain into sendmail.cf for resolve

after add the above /etc/init.d/sendmail restart to restart your sendmail service.

also check /etc/hosts have some like

[root@test etc]# more hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain   localhost
192.168.0.1            mail.yourdomain.com  mail                      <-- this assume your mail server's name is "mail" and the IP is 192.168.0.1

also as UkWizard said check the firewall didn't block the ip for access

hope this info can help






0
 

Author Comment

by:conoverc73
ID: 9861859
Thanks paullamhkg and shivsa.  Both of your tips combined plus realizing that I did not have the sendmail-cf package rpm installed on the machine helped me get this going.  Sendmail is up and running now.

Thanks a lot.
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now