LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   mail.rc For External SMTP (http://www.linuxquestions.org/questions/linux-software-2/mail-rc-for-external-smtp-817482/)

pshankland 07-01-2010 04:00 PM

mail.rc For External SMTP
 
Hi all,

I am running CentOS 5.5 and am trying to get Nagios to send out Emails.

After a bit of reading I have the following in my /etc/mail.rc file:

Code:

[root@linux ~]# cat /etc/mail.rc
set ask askcc append dot save crt
ignore Received Message-Id Resent-Message-Id Status Mail-From Return-Path Via
set smtp=172.29.1.76
You have new mail in /var/spool/mail/root
[root@linux ~]#

I have Nagios setup correctly and introduced an error to generate an Email but nothing has come through.

I suppose I have two questions:

1. Is mail.rc setup correctly?
2. Can I test to see if mail.rc is working correctly?

Thanks.

Berhanie 07-01-2010 07:22 PM

The mail program that comes standard with centos doesn't understand "set smtp". But, you can install the nail rpm (from either epel or rpmforge), which does. The one from rpmforge uses /etc/nail.rc for the config file (newer versions use /etc/mail.rc). You'll also need to adjust your nagios config to use /usr/bin/nail instead of /bin/mail. I don't know the specifics of the epel version.

pshankland 07-02-2010 03:15 AM

Brilliant! Thanks for your help Berhanie :)

Berhanie 07-02-2010 05:44 AM

You're welcome, pshankland.


All times are GMT -5. The time now is 05:22 AM.