Solved

Need help setting up smart host for RHEL5

Posted on 2010-09-16
15
1,509 Views
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?
0
Comment
Question by:js479
  • 6
  • 6
  • 2
  • +1
15 Comments
 
LVL 29

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

Sudeep
0
 
LVL 26

Accepted Solution

by:
jar3817 earned 500 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
0
 
LVL 28

Expert Comment

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

make -C /etc/mail
service sendmail reload
0
 
LVL 1

Author Comment

by:js479
ID: 33702090
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
 
LVL 26

Expert Comment

by:jar3817
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
0
 
LVL 28

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.
0
 
LVL 1

Author Comment

by:js479
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?
0
Do email signature updates give you a headache?

Do you spend too much time managing email signatures? Hate visiting every user’s desk to make updates? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Well, let Exclaimer give your company the email signature it deserves!

 
LVL 1

Author Comment

by:js479
ID: 33702526
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
 
LVL 26

Expert Comment

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

# chkconfig --level 3 sendmail on
0
 
LVL 26

Expert Comment

by:jar3817
ID: 33702551
my commands did the same thing as the jesper's comment...
0
 
LVL 1

Author Comment

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

Expert Comment

by:jar3817
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).
0
 
LVL 1

Author Comment

by:js479
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]#
0
 
LVL 26

Expert Comment

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

Author Comment

by:js479
ID: 33702661
Excellent, thank you!
0

Featured Post

Too many email signature changes to deal with?

Are you constantly being asked to update your organization's email signatures? Do they take up too much of your time? Wouldn't you love to be able to manage all signatures from one central location, easily design them and deploy them quickly to users. Well, you can!

Join & Write a Comment

Utilizing an array to gracefully append to a list of EmailAddresses
New-MailboxSearch Powershell Command and step by step approach to Search and Extract Emails form Exchange 2013 Journaling server.
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…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now