Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Need help setting up smart host for RHEL5

Posted on 2010-09-16
Medium Priority
Last Modified: 2013-12-17
Fresh install of RedHat Enterprise Linux 5.
On a scale of 1 to 10 my skill level with linux is about a 3, please take this into account when replying.

I have an Exchange 2007 server I'd like this redhat box to forward all mail to. The mail coming from this system will just be internal email from the system and Nagios. No outside mail will be hitting this box. I just want to be able to get the alerts via email. I'm assuming this is the easiest way.
I've modified my /etc/mail/sendmail.mc file to define the exchange server.

dnl # Uncomment and edit the following line if your outgoing mail needs to
dnl # be sent out through an external mail server:
dnl #
define(`SMART_HOST', `PA-SV-MSX-001.lxxx.com')dnl
dnl #

The RHEL box can ping the exchange box via FQDN. The next steps I followed from another EE question I found but they didn't work on my system.
Here it is.

[root@Tank mail]# make
WARNING: 'sendmail.mc' is modified. Please install package sendmail-cf to update your configuration.
[root@Tank mail]# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
/etc/mail/sendmail.mc:10: m4: cannot open `/usr/share/sendmail-cf/m4/cf.m4': No such file or directory

So that's where I am, what do i need to do next to make this all proper and have the rehat box send me alerts, either directly or via a smarthost?
Question by:js479
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 6
  • 2
  • +1
LVL 30

Expert Comment

by:Sudeep Sharma
ID: 33697302
Just make sure that the all the sendmail packages are installed on the system including the m4 macro.

First type this command and paste the output here:
rpm -qa | grep sendmail

Second command,
rpm -qa | grep m4

LVL 26

Accepted Solution

jar3817 earned 2000 total points
ID: 33697695
You need the sendmail-cf rpm package. It'll be on the CD/DVD you installed from:

rpm -ivh /path/to/rpms/on/cd/sendmail-cf-8.14.x.x.x.rpm

Once you install that package, you can generate your sendmail.cf with the m4 command. Then you need to restart sendmail:

/etc/rc.d/init.d/sendmail restart
LVL 29

Expert Comment

by:Jan Springer
ID: 33701674
When you modify your sendmail.mc, you need to:

make -C /etc/mail
service sendmail reload
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.


Author Comment

ID: 33702090

[root@Tank mail]# rpm -qa | grep sendmail
[root@Tank mail]# rpm -qa | grep m4
[root@Tank mail]#

I did a "yum install sendmail-cf" and it appears to have installed it but it looks like the new files got appended with .rpmnew, can I just rename the original files to .old and then remove the .rpmnew? Here's the output from yum.

Downloading Packages:
(1/2): sendmail-cf-8.13.8-8.el5.x86_64.rpm                                    | 306 kB     00:00
(2/2): sendmail-8.13.8-8.el5.x86_64.rpm                                       | 637 kB     00:01
Total                                                                253 kB/s | 943 kB     00:03
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating       : sendmail                                                                      1/3
warning: /etc/mail/sendmail.cf created as /etc/mail/sendmail.cf.rpmnew
warning: /etc/mail/sendmail.mc created as /etc/mail/sendmail.mc.rpmnew
  Installing     : sendmail-cf                                                                   2/3
  Cleanup        : sendmail                                                                      3/3

  sendmail-cf.x86_64 0:8.13.8-8.el5

Dependency Updated:
  sendmail.x86_64 0:8.13.8-8.el5
LVL 26

Expert Comment

ID: 33702183
I wouldn't worry about it, your old config should work with the new version. Try remaking the sendmail config and restarting. It should start forwarding to exchange:

# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
# cd /etc/mail && make && /etc/rc.d/init.d/sendmail restart
LVL 29

Expert Comment

by:Jan Springer
ID: 33702430
Once you update the sendmail.mc, do a "make -C /etc/mail".  That will do the job of creating a sendmail.cf.

Author Comment

ID: 33702500
Success! I'm getting emails from the redhat box.

Now is there anything I need to do to preserve all this so when I restart it all still works?

Author Comment

ID: 33702526
I didn't run that command yet aside from the make command jar included in his last comment. The email is working now, do I still need to run that make command or have I already done it with Jar's command?
LVL 26

Expert Comment

ID: 33702540
Glad it's working for you. The only is to make sure sendmail starts on boot:

# chkconfig --level 3 sendmail on
LVL 26

Expert Comment

ID: 33702551
my commands did the same thing as the jesper's comment...

Author Comment

ID: 33702556
[root@Tank ~]# chkconfig --level 3 sendmail on
bash: chkconfig: command not found
[root@Tank ~]#
LVL 26

Expert Comment

ID: 33702603
haha, figures. Look in /etc/rc.d/rc3.d see if there is a S80sendmail file or a K80sendmail file. If it starts with K rename it with an S (uppercase).

Author Comment

ID: 33702645
It's S80, 4th column, 2nd row from top.

[root@Tank etc]# cd /etc/rc.d/rc3.d/
[root@Tank rc3.d]# ls
K00ipmievd         K36mysqld           S00microcode_ctl    S15mdmonitor       S58ntpd
K01dnsmasq         K45arpwatch         S02lvm2-monitor     S18rpcidmapd       S80sendmail
K02avahi-dnsconfd  K50netconsole       S04readahead_early  S19rpcgssd         S85gpm
K02NetworkManager  K50tux              S05kudzu            S22messagebus      S90crond
K05conman          K69rpcsvcgssd       S06cpuspeed         S23setroubleshoot  S90xfs
K05saslauthd       K73ypbind           S07iscsid           S25bluetooth       S95anacron
K05wdaemon         K74ipmi             S08ip6tables        S25netfs           S95atd
K10dc_server       K74nscd             S08iptables         S25pcscd           S97libvirtd
K10psacct          K80kdump            S08mcstrans         S26acpid           S97rhnsd
K12dc_client       K85mdmpd            S10network          S26haldaemon       S97yum-updatesd
K15httpd           K87multipathd       S11auditd           S26hidd            S98avahi-daemon
K20nfs             K88wpa_supplicant   S12restorecond      S28autofs          S98xend
K24irda            K89dund             S12syslog           S50hplip           S99firstboot
K25squid           K89netplugd         S13irqbalance       S55sshd            S99local
K35smb             K89pand             S13iscsi            S56cups            S99nagios
K35vncserver       K89rdisc            S13portmap          S56rawdevices      S99smartd
K35winbind         K99readahead_later  S14nfslock          S56xinetd          S99xendomains
[root@Tank rc3.d]#
LVL 26

Expert Comment

ID: 33702654
good, that means it'll start when entering runlevel 3 (standard multiuser level). You should be all set.

Author Comment

ID: 33702661
Excellent, thank you!

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Resolve DNS query failed errors for Exchange
The main intent of this article is to make you aware of ‘Exchange fail to mount’ error, its effects, causes, and solution.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
Suggested Courses

618 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