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!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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: 3B9B1182CD6B: uid=1001 from=<nagios@VmLinux>
Aug 17 17:08:42 VmLinux postfix/cleanup: 3B9B1182CD6B: message-id=<20140817150842.3B9B1182CD6B@VmLinux>
Aug 17 17:08:42 VmLinux postfix/qmgr: 3B9B1182CD6B: from=<nagios@VmLinux>, size=667, nrcpt=1 (queue active)
Aug 17 17:08:42 VmLinux postfix/smtp: 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: 3B9B1182CD6B: to=<email@example.com>, relay=smtp.hispeed.ch[22.214.171.124]:25, delay=0.49, delays=0.13/0.01/0.31/0.04, dsn=5.1.0, status=bounced (host smtp.hispeed.ch[126.96.36.199] said: 550 5.1.0 <nagios@vmlinux> sender rejected (in reply to MAIL FROM command))
Aug 17 17:08:42 VmLinux postfix/cleanup: ACB81182CD76: message-id=<20140817150842.ACB81182CD76@VmLinux>
Aug 17 17:08:42 VmLinux postfix/qmgr: ACB81182CD76: from=<>, size=2457, nrcpt=1 (queue active)
Aug 17 17:08:42 VmLinux postfix/bounce: 3B9B1182CD6B: sender non-delivery notification: ACB81182CD76
Aug 17 17:08:42 VmLinux postfix/qmgr: 3B9B1182CD6B: removed
Aug 17 17:08:42 VmLinux postfix/local: 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: