Xymon Mailing List Archive search

configurable sender email address for alerts?

list Jeremy Laidman
Fri, 17 Jan 2014 13:20:06 +1100
Message-Id: <user-8e2f1c2a5d2d@xymon.invalid>

Some versions of mailx do not support "-r".  However, some versions of
mailx allow you to specify arguments to be sent to sendmail like so:

echo test message | mailx -v -s subject user-499f1c0dd1f6@xymon.invalid -
user-7103dcc67637@xymon.invalid

So in this example, mailx will finish parsing switches when it gets to
addresses, and any switch-like arguments after the addresses will get sent
to sendmail.

Unfortunately, you can't use this with MAILC, as Xymon appends the email
addresses to the end.  Instead, you could create your own script to use in
MAILC.  Something like:

#!/bin/sh
if [ "$FROMADDR" ]; then mailx "$@" -f"$FROMADDR"; else mailx "$@"; fi

Then set

MAILC="FROMADDR='user-5badfa275f87@xymon.invalid' mymailx"

Or perhaps install a new MUA, such as "nail" - one that supports "-r".

J


On 17 January 2014 05:50, John Thurston <user-ce4d79d99bab@xymon.invalid> wrote:
On 1/16/2014 8:56 AM, Mark Felder wrote:
I have a FreeBSD bug report open from a user who claims that if they run
"sudo service xymon-server start" it starts xymon correctly but the
alert emails come from the wrong email address. Where is Xymon getting
the username from to use when sending emails? Is it configurable in
xymonserver.cfg? Could it be made configurable? The patch the user
suggested to the freebsd rc script seems unnecessary.
I tried setting the value of MAILC in xymonserver.cfg:
 MAILC="mailx -r user-72e0e34f549e@xymon.invalid "

My test with  xymond_alert  report that the -r parameter will be used with
mailx, but when Xymon actually sends the messages it is not.

--
   Do things because you should, not just because you can.

John Thurston    XXX-XXX-XXXX
user-ce4d79d99bab@xymon.invalid
Enterprise Technology Services
Department of Administration
State of Alaska