I've got a Debian 11 system running as a local file server. I want to keep it as simple as possible but have some basic monitoring from Monit. I've installed and configured msmtp
and msmtp-mta
and I've confirmed that I can send test messages from the command line with
mail -s "test" address@email.com <<END
This is a test
END
and I've got emails coming through from unattended-upgrades
.
I've seen guides where SMTP details are entered in the Monit config files, but I would prefer to only have the details stored in one place (/etc/msmtprc
), so in my monit config file I've put set mailserver localhost
. Monit is trying and failing to connect - in /var/log/monit.log
I see:
[2023-04-25T16:43:24+0100] error : Cannot connect to [localhost]:25 -- Connection refused
[2023-04-25T16:43:24+0100] error : Cannot open a connection to the mailserver localhost:25 -- Operation now in progress
[2023-04-25T16:43:24+0100] error : Mail: Delivery failed -- no mail server is available
Have I misunderstood something?