Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-17-2014, 10:18 AM   #1
Registered: Aug 2014
Posts: 40

Rep: Reputation: Disabled
Nagios mail notifications

Hello, I have set up Nagios4 with Ubuntu14, and everything works fine. I have also set up Postfix to use a smarthost ( which accepts plain auth (userid, pwd). That also works fine and I can send mail via postfix by telnetting into localhost smtp.
However, when Nagios tries to send notifications, they appear to get rejected by the provider. The log says:

Aug 17 17:08:42 VmLinux postfix/pickup[13747]: 3B9B1182CD6B: uid=1001 from=<nagios@VmLinux>
Aug 17 17:08:42 VmLinux postfix/cleanup[13877]: 3B9B1182CD6B: message-id=<20140817150842.3B9B1182CD6B@VmLinux>
Aug 17 17:08:42 VmLinux postfix/qmgr[1844]: 3B9B1182CD6B: from=<nagios@VmLinux>, size=667, nrcpt=1 (queue active)
Aug 17 17:08:42 VmLinux postfix/smtp[13879]: connect to[2001:730:3e10:0:213:46:255:24]:25: Network is unreachable
Aug 17 17:08:42 VmLinux postfix/smtp[13879]: 3B9B1182CD6B: to=<>,[]:25, delay=0.49, delays=0.13/0.01/0.31/0.04, dsn=5.1.0, status=bounced (host[] said: 550 5.1.0 <nagios@vmlinux> sender rejected (in reply to MAIL FROM command))
Aug 17 17:08:42 VmLinux postfix/cleanup[13877]: ACB81182CD76: message-id=<20140817150842.ACB81182CD76@VmLinux>
Aug 17 17:08:42 VmLinux postfix/qmgr[1844]: ACB81182CD76: from=<>, size=2457, nrcpt=1 (queue active)
Aug 17 17:08:42 VmLinux postfix/bounce[13880]: 3B9B1182CD6B: sender non-delivery notification: ACB81182CD76
Aug 17 17:08:42 VmLinux postfix/qmgr[1844]: 3B9B1182CD6B: removed
Aug 17 17:08:42 VmLinux postfix/local[13881]: ACB81182CD76: to=<nagios@VmLinux>, relay=local, delay=0.09, delays=0.04/0.01/0/0.04, dsn=2.0.0, status=sent (delivered to mailbox)

What might be wrong? Methinks that the authentication goes fine with telnet, but for some reason the messages sent by Nagios do not get authenticated. Many thanks in advance for any help! I am guessing that the "Network is unreachable" message relates to the non-existance of a IPv6 host and can be disregarded.
Old 08-17-2014, 11:25 PM   #2
LQ Newbie
Registered: Jan 2011
Posts: 14

Rep: Reputation: 4
This is one of those cases where extra messages obscure the simple error. the "sender rejected" part is the relevant bit: your machine is presenting a bogus "From: nagios@VmLinux" line. just fully qualify that address and it'll be OK. (this can sometimes be done in the mail-generating config, but is probably better if you handle it at the system level, such as myorigin in postfix, or just setting hostname properly...)
Old 08-18-2014, 05:38 AM   #3
LQ Newbie
Registered: Nov 2008
Posts: 11

Rep: Reputation: 0
postfix conf

A very simple postfix conf, adjust accordingly, this is not specific to Ubuntu, just postfix is required, additionally set SPF record for your IP as allowed sender for your sender domain, ignore TLS part, that's specific to my settings.

# See /usr/share/postfix/ for a commented, more complete version

# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = cluster, localhost.localdomain, , localhost
relayhost =
mynetworks = [::ffff:]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all (END)
Old 08-22-2014, 11:51 PM   #4
Registered: Aug 2014
Posts: 40

Original Poster
Rep: Reputation: Disabled
Thank you all for your kind help. You have correctly directed me to the error in the email qualification. I decided to fix this in Nagios rather than Postfix, since the latter may have affected other Postfix-dependent applications as well.

I had some trouble finding the Nagios option which would allow for changing the originator email. The flag that needs to be added to the Nagios "host-notify-by-mail" or "service-notify-by-mail" commands in the file "commands.cfg" reads as follows:

-a "From:"

Note that the quotation marks are essential!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Advanced Notifications with Nagios matisq Linux - Server 9 01-06-2009 03:04 AM
Nagios Email notifications jackie001 Linux - Newbie 3 11-14-2008 10:58 AM
Nagios e-Mail notifications netmaster3620 Linux - Newbie 1 07-01-2008 07:33 PM
Nagios notifications nuganen Linux - Newbie 1 06-20-2008 02:13 PM
E-mail notifications not working with nagios hondo Linux - Server 3 10-28-2007 12:42 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:09 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration