I have a CentOS 8-stream server. I was setting up smartmontools
to monitor my drives. The MTA is msmtp
. To test the setup, I modified my smartd.conf
by adding:
/dev/sda -a -m [email protected] -M test
Since I did not see any mail popping up, I decided to check the journal:
journalctl -u smartd
which gave the following:
smartd[1184]: Executing test of <mail> to [email protected]...
smartd[1184]: Test of <mail> to [email protected] produced unexpected output (459 bytes) to STDOUT/STDERR:
smartd[1184]: send-mail: cannot connect to smtp.gmail.com, port 587: Permission denied
smartd[1184]: send-mail: could not send mail (account default from /etc/msmtprc)
smartd[1184]: send-mail: cannot log to /var/log/msmtp.log: cannot open: Permission denied
smartd[1184]: send-mail: log info was: host=smtp.gmail.com tls=on auth=on [email protected] [email protected] [email protected] errormsg='cannot connect to smtp.gmail.com, port 587: Permission denied' exitcode=EX_TEMPFAIL
So, I tried:
echo "My message" | mail -s "Some subject" [email protected]
which does send the mail, but still shows the error:
send-mail: cannot log to /var/log/msmtp.log: cannot open: Permission denied
I thought, it might be an issue with SE permissions, so I checked:
getsebool -a | grep mail
which gave:
gitosis_can_sendmail --> off
httpd_can_sendmail --> on
logging_syslogd_can_sendmail --> on
logwatch_can_network_connect_mail --> on
mailman_use_fusefs --> off
postfix_local_write_mail_spool --> on
I have two errors, but no idea how to rectify these. Would be glad if someone could point me in the right direction.
Thanks a bunch!