# My mail server configuration on /etc/monit/monitrc
set mailserver smtp.telfortglasvezel.nl port 587
username "[email protected]" password "PASSWORD"
using AUTO
with timeout 30 seconds
set alert [email protected]
When this script is active monit sends the following error
[2024-07-03T13:15:00+0200] info : 'mcmellow-pi' Monit 5.27.2 started
[2024-07-03T13:15:01+0200] error : Mail: Mailserver response error -- 501 5.1.7 Bad sender address syntax
[2024-07-03T13:15:01+0200] info : Adding event to the queue file /var/lib/monit/events/1720005301_55745a71c0 for later delivery
[2024-07-03T13:15:01+0200] error : Mail: Mailserver response error -- 501 5.1.7 Bad sender address syntax
[2024-07-03T13:15:01+0200] error : Alert handler failed, retry scheduled for next cycle
The configuration uses the same things as used for Domoticz sending notifications by email. That works OK.
Is there something I overlooked or is wrong?
Is mail outside Domoticz, like with bash, working?
Because Domoticz has his own smtpclient for sending mail, Monit does not, it uses the system mailclient afaik.
Logic will get you from A to B. Imagination will take you everywhere.
Kedi wrote: ↑Wednesday 03 July 2024 14:27
Is mail outside Domoticz, like with bash, working?
Because Domoticz has his own smtpclient for sending mail, Monit does not, it uses the system mailclient afaik.
Which smtpclient can I use to send mail from a Raspberry Pi
<-- 501 5.1.7 Bad sender address syntax
msmtp: envelope from address default not accepted by the server
msmtp: server message: 501 5.1.7 Bad sender address syntax
msmtp: could not send mail (account default from /etc/msmtprc)
So what's the content of /etc/msmtprc or (what I use) .msmtprc in the home directory.
/etc/msmtprc is the global setting in the home dir is the user setting.
Read the doc. https://marlam.de/msmtp/documentation/
Kedi wrote: ↑Wednesday 03 July 2024 21:10
B.t.w. I looked a little bit further in my system (it was a long time ago I configured monit)
It looks now to me that monit can mail internally. https://mmonit.com/monit/documentation/ ... t-delivery
That is the way it is also explained in the Domoticz wiki. See my first posting.
waltervl wrote: ↑Thursday 04 July 2024 16:26
If Domoticz server is not responding it will be restarted by monit and Domoticz will send the notification.
Thanks for your reply.
Yes, that is working OK. Domoticz does send a notification when restarted. But I do monitor others running services as well with Monit Therefor I will have the Monit mailserver up and running.
@waltervl Your right. But then you get an email every time Domoticz is (re)started and there is no notification about the cause.
With Monit you can, and even monitor other processes on the same way.
That is why I use Monit, because Domoticz by default does not monitor my tmpfs /var/log and other processes that are in my case vital to Domoticz like Mosquitto and Node-Red and Zigbee2MQTT.
Logic will get you from A to B. Imagination will take you everywhere.
# My mail server configuration on /etc/monit/monitrc
set mail-format {
from: MonitPi<[email protected]>
subject: $SERVICE $EVENT at $DATE
message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION.
Yours sincerely,
monit
}
set mailserver smtp.telfortglasvezel.nl port 587
username "[email protected]" password "PASSWORD"
using AUTO
with timeout 30 seconds
set alert [email protected]