[Xymon] Xymon send email using Mail command with -r problem.

Malcolm Hunter malcolm.r.hunter at gmail.com
Thu Feb 13 11:35:17 CET 2020


On Thu, 13 Feb 2020 at 02:52, Alex Tang <bear410hk at gmail.com> wrote:

> Hi All,
>
>
> I had a Xymon server need send email with a special sender email address,
> because of mail server had limitation sender must be company email domain (
> xxxx at abc.com) if I need send email to external email such as gmail or SMS
> service. I had added Xymon XXXX at abc.com in Sendmail genericstable but not
> working. Also, I had tried to rename the hostname from
> xymonserver.localdomain.com to xymonserver.abc.com it works, but we
> cannot change the hostname it will make the other problem.
>
>
>
> I can't use -r in Alert.cfg, for example : MAIL -r alex. at abc.com
> alexalex at extenalweb.com SERVICE=uptime,conn
>
>
>
> it will not send out and Xymon alert.log shows below error
>
>
>
> mail: option requires an argument -- r
>
> Usage: mail -eiIUdEFntBDNHRVv~ -T FILE -u USER -h hops -r address -s
> SUBJECT -a FILE -q FILE -f FILE -A ACCOUNT -b USERS -c USERS -S OPTION users
>
>
>
> so, I tried to change x=xymonserver.cfg but not working, I added -r in
> Mail="$MAILC -s"
>
>
>
> # For the xymond_alert module
>
> MAILC="mail"                            # Command used to send an e-mail
> with no subject
>
> MAIL="$MAILC -r -s"                     # Command used to send an e-mail
> with a subject
>
>
>
> may I know the setting of xymonserver.cfg to allow MAIL Command to use -r
> in Xymon alert.cfg?
>
>
>
> P.S: I can use mail -r to send out email in centos 7.
>
>  Xymon 4.3.28
>
> <http://lists.xymon.com/mailman/listinfo/xymon>


How I did this was just to change Postfix myorigin to the domain of choice
and change the entry in xymonserver.cfg MAILC="mail -r username"

e.g. xymonserver.cfg: MAILC="mail -r xymon_site1"
/etc/postfix/main.cf: myorigin = mydomain.com

This will send emails from xymon_site1 at mydomain.com

HTH
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20200213/bd3b08bb/attachment.htm>


More information about the Xymon mailing list