js479
asked on
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')d nl
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?
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')d
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
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?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
When you modify your sendmail.mc, you need to:
make -C /etc/mail
service sendmail reload
make -C /etc/mail
service sendmail reload
ASKER
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.x 86_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.rpmn ew
warning: /etc/mail/sendmail.mc created as /etc/mail/sendmail.mc.rpmn ew
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
[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.x
(2/2): sendmail-8.13.8-8.el5.x86_
--------------------------
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.rpmn
warning: /etc/mail/sendmail.mc created as /etc/mail/sendmail.mc.rpmn
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
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
# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
# cd /etc/mail && make && /etc/rc.d/init.d/sendmail restart
Once you update the sendmail.mc, do a "make -C /etc/mail". That will do the job of creating a sendmail.cf.
ASKER
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?
Now is there anything I need to do to preserve all this so when I restart it all still works?
ASKER
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?
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?
Glad it's working for you. The only is to make sure sendmail starts on boot:
# chkconfig --level 3 sendmail on
# chkconfig --level 3 sendmail on
my commands did the same thing as the jesper's comment...
ASKER
[root@Tank ~]# chkconfig --level 3 sendmail on
bash: chkconfig: command not found
[root@Tank ~]#
bash: chkconfig: command not found
[root@Tank ~]#
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).
ASKER
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]#
[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]#
good, that means it'll start when entering runlevel 3 (standard multiuser level). You should be all set.
ASKER
Excellent, thank you!
First type this command and paste the output here:
rpm -qa | grep sendmail
Second command,
rpm -qa | grep m4
Sudeep