Xymon Mailing List Archive search

Xymon send email using Mail command with -r problem.

list Ron Cohen
Thu, 13 Feb 2020 11:17:06 +0000
Message-Id: <user-ae969f4ce1e4@xymon.invalid>

it is also possible to use mutt instead of mail and use the REPLYTO variable or create .muttrc with the return address. I think the domain definition should go into the $hostname and also use-domain should be set to no.



On 13/02/2020 10:35, Malcolm Hunter wrote:


On Thu, 13 Feb 2020 at 02:52, Alex Tang <user-742b3d7cdc50@xymon.invalid> 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 (user-8fda1a1d6b1b@xymon.invalid) if I need send email to external email such as gmail or SMS service. I had added Xymon user-8fda1a1d6b1b@xymon.invalid 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 user-0c97b362772f@xymon.invalid user-35ab528d2aec@xymon.invalid 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


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 user-614793e15de4@xymon.invalid

HTH



Xymon@xymon.com