My mail command does not support the –r option. I cannot see a way to force the from address, so I guess it is running it as the hobbit user. I have configured the hobbit user in /etc/email-addresses as “hobbit: user-89c6ab9913ee@xymon.invalid<mailto:user-89c6ab9913ee@xymon.invalid>” but Exim4 doesn’t seem to be using this. It definitely looks like it is something I will have to take up with the Exim4 group since now I can see the command that hobbit is using and that it isn’t the one forcing “hobbit@” as the wrong address.
Results from “mail -r”:
hhcgvl-moni03:~# mail -r
mail: invalid option -- r
usage: mail [-eIinv] [-a header] [-b bcc-addr] [-c cc-addr] [-s subject]
to-addr [...] [-- sendmail-options [...]]
mail [-eIiNnv] -f [name]
mail [-eIiNnv] [-u user]
hhcgvl-moni03:~#
Thanks for the help guys, I’ll take this over to the Exim4 mailing list now :-)
From: J Sloan [mailto:user-b1d2c84d244b@xymon.invalid]
Sent: Thursday, June 04, 2009 3:16 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] How do I change the "mail from" for email alerts?
Harold J. Ballinger wrote:
My /var/spool/exim4/msglog is filling up with messages similar to the following:
2009-06-04 12:26:17 Received from hobbit@ U=hobbit P=local S=929
2009-06-04 12:26:33 user-d5cf6b2f7d35@xymon.invalid<mailto:user-d5cf6b2f7d35@xymon.invalid> <user-d5cf6b2f7d35@xymon.invalid><mailto:user-d5cf6b2f7d35@xymon.invalid> R=dnslookup T=remote_smtp: SMTP error from remote mailer after MAIL FROM:<hobbit@> SIZE=1973: host exchange.mydomain [10.10.10.21]: 501 5.5.4 Invalid Address
Process failed (1) when writing error message to hobbit@ (frozen)
I have reconfigured Exim4 to allow remote mail, but I can’t find a way to make the email alerts from hobbit/xymon use a different “MAIL FROM” than “hobbit@”, which our Exchange server knows is not a valid address.
I have tried making sure that the hostname is defined in the bbserver config and that the domain is configured in resolv.conf. I also tried creating an entry for “hobbit: user-5c8ec6c92842@xymon.invalid<mailto:user-5c8ec6c92842@xymon.invalid>” in /etc/email-addresses
I’m not a *nix guru by any means, and I’m sure this is something simple that I’m missing?
Did you adjust the relevant section of ~/server/etc/hobbitserver.cfg to suit your needs?
# For the hobbitd_alert module
MAILC="mail -r user-cfef8cc339f2@xymon.invalid<mailto:user-cfef8cc339f2@xymon.invalid>" # Command to send an e-mail with no subject
MAIL="$MAILC -r user-5b6031c6dfca@xymon.invalid<mailto:user-5b6031c6dfca@xymon.invalid> -s" # Command to send an e-mail with a subject
Joe