Description of problem: setroubleshoot-server cannot send email alerts because of an exception in /usr/lib/python3.4/site-packages/setroubleshoot/email_alert.py. The error shown in the logs: Jan 09 11:18:32 example.com setroubleshoot[1230]: Exception during AVC analysis: No module named 'email.MIMEText'. I have actually figured out what the issue is. In email_alert.py Line 26 it says: "from email.MIMEText import MIMEText" This works in python2.7 (which I suspect this package was using at some point), but does NOT work in python3.4 as the library names have changed. According to the Package History section on this page https://docs.python.org/2/library/email.html (quoting a bullet point): "- A new subpackage email.mime was added and all the version 3 email.MIME* modules were renamed and situated into the email.mime subpackage. For example, the version 3 module email.MIMEText was renamed to email.mime.text." I have confirmed this new naming. Old way that doesn't work: python3.4 Python 3.4.3 (default, Jun 29 2015, 12:15:26) [GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from email.MIMEText import MIMEText Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named 'email.MIMEText' >>> New way that does work: python3.4 Python 3.4.3 (default, Jun 29 2015, 12:15:26) [GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from email.mime.text import MIMEText >>> So basically, I think all of the import lines in email_alert.py need to be updated to reference the new library names. I suspect the file was written and works in an earlier python, but now it is installed for python3.4 and doesn't work anymore. I am not a python developer so I hope this analysis was helpful or points you in the right direction. Thanks! Version-Release number of selected component (if applicable): setroubleshoot-server-3.3.1-0.2.fc23.i686 How reproducible: Always Steps to Reproduce: 1. Put an email address in /var/lib/setroubleshoot/email_alert_recipients 2. cause avc denial 3. journalctl -f SYSLOG_IDENTIFIER=setroubleshoot Actual results: No email is sent, error message printed to log Expected results: Email is sent Additional info:
Thanks for the report and deep investigation! Indeed it's python 3 rewrite problem. I'll provide an update soon.
https://github.com/fedora-selinux/setroubleshoot/commit/407ca6eb14e2642db2a17694dbb12986f67ca780
setroubleshoot-3.3.3-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-8f471924e8
setroubleshoot-3.3.3-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-8f471924e8
setroubleshoot-3.3.3-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.