[Xymon] configurable sender email address for alerts?

Jeremy Laidman jlaidman at rebel-it.com.au
Fri Jan 17 03:20:06 CET 2014


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 email.address at example.com -
fnoreply at example.com

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='noreply at example.com' mymailx"

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

J



On 17 January 2014 05:50, John Thurston <john.thurston at alaska.gov> 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 noreply at foo.com "
>
> 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    907-465-8591
> John.Thurston at alaska.gov
> Enterprise Technology Services
> Department of Administration
> State of Alaska
>
> _______________________________________________
> Xymon mailing list
> Xymon at xymon.com
> http://lists.xymon.com/mailman/listinfo/xymon
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20140117/09eeb550/attachment.html>


More information about the Xymon mailing list