More details:
In xymonserver.cfg, I have
#MAILC="mail"
MAILC="/usr/local/hobbit/server/mail_nocr.sh" # Command used to send an
e-mail with no subject
MAIL="$MAILC -s" # Command used to send an
e-mail with a subject
The mail_nocr.sh script is like this:
#! /bin/bash
# 20130104 - glauber - get rid of CR in emails
exec /usr/bin/tr -d '\015' | /bin/mail "$@"
That's all, folks!
The occasional CR in the emails not only mess up the SMS gateways, they
also make Exchange turn a simple message into an email with a binary
attachment.
g
-----Original Message-----
From: Xymon [mailto:xymon-bounces at xymon.com] On Behalf Of Ribeiro, Glauber
Sent: Thursday, February 05, 2015 09:37
To: Benjamin Smith; xymon at xymon.com
Subject: Re: [Xymon] Xymon notifcations disappear due to base64 encoding
I've always had this problem. I ended up setting the mail client in xymon
server (via the configuration file) to be a script that pipes the messages
through tr to delete the CRs, then pipes then to mail.
g
-----Original Message-----
From: Xymon [mailto:xymon-bounces at xymon.com] On Behalf Of Benjamin Smith
Sent: Wednesday, February 04, 2015 19:06
To: xymon at xymon.com
Subject: [Xymon] Xymon notifcations disappear due to base64 encoding
This morning, one of our servers was down and we (the admins) didn't
immediately know because of a long chain of events. After spending the
morning
drilling down step by step, the issue was that Verizon's SMS email gateway
doesn't accept base64 encoded messages, and the message being sent was
base64
encoded because of <CR> (aka "\r" or ASCII 13) in the message.
We could reproduce this issue with the following PHP script used at the
command line as a Verizon customer. I don't know if this is a recent
change at
Verizon, and don't really have a way to find out.
// GENERAL ENVIRONMENT
CentOS 6, recently updated.
Postfix is the MTA
PHP5
// THIS WON'T WORK Note the "\r" that causes postfix to base64 encode the
message.
file.php's contents, 1 line:
<?php echo "Test of bad message\r\n"; ?>
$ php file.php | mail -s test user-7e577af8398b@xymon.invalid
// THIS WORKS FINE, Note the lack of "\r", postfix sends this as
text/plain, 7
bit encoding.
file.php's contents, 1 line:
<?php echo "Test of bad message\n"; ?>
$ php file.php | mail -s test user-7e577af8398b@xymon.invalid
We've wasted time playing with a wrapper for the mail command that would
strip
out the "\r" in the alerts but this has, so far, proven fruitless. Messages
sent via the Sprint SMS gateway go through just fine. Wondering if anybody
else
has seen this issue, or has any idea what the best way to handle it might
be?
Thanks,
Ben