Website

Matthew O'Hare

Home   SAP R/3   Travel   Computers/Tech   Food & Drink   Contact me

Sendmail on RedHat/Fedora Linux

I wanted to be able to send email from Outlook using sendmail on my RedHat Linux server. Sendmail ships with a default configuration file which only allows for email to be sent from the server machine. Changing the configuration isn't very difficult, but here's a quick guide anyway:

Make sure that you've installed the sendmail-cf RPM. Mirrors can be found here. Login as root then type "rpm -ivf [packagename.rpm]" replacing [packagename.rpm] with the RPM you've just downloaded. If you already have the package installed then you can skip this step.

Edit /etc/mail/access with your favourite text editor and add the IP address of the machine you're wanting to relay from, e.g.:
192.168.100.2 RELAY
then do a "makemap hash /etc/mail/access < /etc/mail/access" whilst in the /etc/mail/ directory.

You now have to edit the sendmail.mc file. A line which looks something like:
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
needs to be commented out. Type dnl before it, e.g.
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
You'll now need to recreate your sendmail.rc file, so as root:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
and restart sendmail. (Use "service sendmail restart", or /sbin/service sendmail restart.)

If you're not able to connect you may have firewall issues or it may be a TCP wrappers issue. Check /etc/hosts.allow file: sendmail may need to be added, e.g. sendmail 192.168.100.2 and the xinetd service restarted.

Hope you find this useful!