Score:1

Smartd unable to send mail

sk flag

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!

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.