Linux - NewbieThis 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!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello, I have set up Nagios4 with Ubuntu14, and everything works fine. I have also set up Postfix to use a smarthost (smtp.hispeed.ch) 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 smtp.hispeed.ch 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 smtp.hispeed.ch[2001:730:3e10:0:213:46:255:24]:25: Network is unreachable
Aug 17 17:08:42 VmLinux postfix/smtp[13879]: 3B9B1182CD6B: to=<adriano.123@usz.ch>, relay=smtp.hispeed.ch[213.46.255.24]:25, delay=0.49, delays=0.13/0.01/0.31/0.04, dsn=5.1.0, status=bounced (host smtp.hispeed.ch[213.46.255.24] 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.
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...)
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/main.cf.dist 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
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:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.