Need help setting up smart host for RHEL5

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?
LVL 1
js479Asked:
Who is Participating?
 
jar3817Connect With a Mentor Commented:
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
0
 
Sudeep SharmaTechnical DesignerCommented:
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

Sudeep
0
 
Jan SpringerCommented:
When you modify your sendmail.mc, you need to:

make -C /etc/mail
service sendmail reload
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
js479Author Commented:
SSharma:

[root@Tank mail]# rpm -qa | grep sendmail
sendmail-8.13.8-2.el5
[root@Tank mail]# rpm -qa | grep m4
m4-1.4.5-3.el5.1
[root@Tank mail]#

jar3817:
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

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

Dependency Updated:
  sendmail.x86_64 0:8.13.8-8.el5
0
 
jar3817Commented:
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
0
 
Jan SpringerCommented:
Once you update the sendmail.mc, do a "make -C /etc/mail".  That will do the job of creating a sendmail.cf.
0
 
js479Author Commented:
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?
0
 
js479Author Commented:
jesper:
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?
0
 
jar3817Commented:
Glad it's working for you. The only is to make sure sendmail starts on boot:

# chkconfig --level 3 sendmail on
0
 
jar3817Commented:
my commands did the same thing as the jesper's comment...
0
 
js479Author Commented:
[root@Tank ~]# chkconfig --level 3 sendmail on
bash: chkconfig: command not found
[root@Tank ~]#
0
 
jar3817Commented:
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).
0
 
js479Author Commented:
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]#
0
 
jar3817Commented:
good, that means it'll start when entering runlevel 3 (standard multiuser level). You should be all set.
0
 
js479Author Commented:
Excellent, thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.