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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

Nearly six years ago I was hired by a company to be their senior server engineer. One of my first projects was to implement Exchange Server 2007 on a Windows Server 2008 Single Copy Cluster for high availability. That was the easy part; read on to l…
Resolve Outlook connectivity issues after moving mailbox to new Exchange 2016 server
Familiarize people with the process of utilizing SQL Server views 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 Microsoft Access…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
Suggested Courses

770 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