Skip to content

A Tail of Mail

December 7, 2012

My organization is just changing over to Office 365 from an internal Exchange setup. As I’m writing this, we’re in the final stages. Just yesterday, I decided that it was finally time to get a blog to write down the solutions I find to all the ridiculous little idiosyncrasies I’ve run into recently during this transition as well as those that I come across in the future. So, on with the one I ran into yesterday:

To facilitate the monitoring of our internal and external servers, we use Nagios. We are mostly a Microsoft shop where I work but I have a couple of Linux servers dedicated to important tasks such as this. However, after we switched over to Office 365, the forwarding of notifications from Nagios obviously stopped working. Previously I had notifications being relayed from Nagios by Postfix to our Exchange server and over to my mailbox. However, with the Office 365 transition, I needed to use Postfix as a relay to Office 365. I thought this would be as simple as modifying my main.cf to relay to the Office 365 server, having Postfix authenticate with my email address, and having Nagios send mail as if it was me. This was the correct course of action. However, what I had not planned on was that I continued to get error messages when trying to change the “FROM:” address on the notify-host-by-email and notify-service-by-email commands in Nagios. The exact error messages I was getting were:

Dec 5 22:32:55 monitorserv postfix/qmgr[2010]: AA89C40515: from=<administrator@monitorserv.myorg.local>, size=401, nrcpt=2 (queue active)
Dec 5 22:32:55 monitorserv postfix/error[2083]: AA89C40515: to=<-fmyaccount@myorg.com>, relay=none, delay=0.14, delays=0.08/0/0/0.06, dsn=5.1.3, status=bounced (bad address syntax)

For some reason, the /usr/bin/mail command was not accepting the -f argument like it should have been. I also tried the -r flag as suggested by several other blogs and forums to no avail. I went searching all over the web and eventually came to the realization that Ubuntu had included the wrong “mail.” Here are the details regarding mail, Mail, and mailx: http://heirloom.sourceforge.net/mailx_history.html Apparently Ubuntu 10.10 uses standard old “mail” which does not support a parameter to change the “FROM:” address. The solution was simple enough: install “Mail” (or Berkeley Mail as it is known) by doing:

sudo apt-get install heirloom-mailx

It was then just a matter of changing the references in the Nagios commands from /usr/bin/mail to /usr/bin/Mail and the flag worked as expected. I hope this helps someone else.

Advertisements

From → Uncategorized

3 Comments
  1. coDErED permalink

    Hey Do you have any idea about seeting up a Office 360 ?
    My task bit differrent. 1st i’ve to setup office 360 & 2nd i’ve to monitor those thogns through Nagios.

    I’ve familiar with Nagios, but not Office 360.

    Can u tell me how to setup Office 360.

    Thanks

    • That’s a bit too general of a question, I’m afraid. “How to set up Office 365” is a complex topic and depends entirely on your organizational structure. Sorry, friend. You’ll have to do more digging.

Trackbacks & Pingbacks

  1. Today's Linux Server LinksNine OM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: