Discussion:
Sending alert email through Amazon SES SMTP interface - issue with TLS
PJ Fan
2011-12-27 19:15:47 UTC
Permalink
PJ Fan [http://community.zenoss.org/people/pjfan] created the discussion

"Sending alert email through Amazon SES SMTP interface - issue with TLS"

To view the discussion, visit: http://community.zenoss.org/message/63439#63439

--------------------------------------------------------------
Hello,

I'm trying to setup Zenoss 3.2.1 to send email alerts through Amazon's new SMTP interface on their SES service.  Amazon requires the use of TLS to send email, but it seems their definition of TLS is different than Zenoss's.  According to the thread at https://forums.aws.amazon.com/thread.jspa?threadID=82510&tstart=0&start=0 https://forums.aws.amazon.com/thread.jspa?threadID=82510&tstart=0&start=0 the Amazon service is using what is traditionally referred to as SSL in that the entire connection is encrypted.

Whether or not TLS is enabled through Zenoss's email configuration, I get a time out error when trying to send a test email. Previously I was using my own mail server (without TLS), so I know email is working at least.

Has anyone gotten around this issue?  I've looked at little at the Python smtplib and it looks like smtplib.SMTP_SSL (rather than using starttls) would work, but I'm not sure how to modify the Zenoss Python scripts to use that instead.  Any help would be appreciated.

Thanks!

--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/63439#63439]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
PJ Fan
2011-12-30 01:00:46 UTC
Permalink
PJ Fan [http://community.zenoss.org/people/pjfan] created the discussion

"Re: Sending alert email through Amazon SES SMTP interface - issue with TLS"

To view the discussion, visit: http://community.zenoss.org/message/63477#63477

--------------------------------------------------------------
I was able to implement a temporary fix for this by modifying 2 Python scripts:

1. In $ZENHOME/zenoss/Products/ZenUtils/Utils.py change line 657 to "server = smtplib.SMTP_SSL(host, port)".  This forces Python to use SSL for the connection to the mail server.  See http://docs.python.org/library/smtplib.html http://docs.python.org/library/smtplib.html
2. In $ZENHOME/python/lib/python2.6/smtplib.py change line 292 to "self._get_socket(host, port, self.timeout)".  This is due to a bug in the version of Python that Zenoss uses.  Otherwise you will get an error about needing to call connect() first.  See http://bugs.python.org/issue4066 http://bugs.python.org/issue4066



After making these changes I restarted the server and unchecked the TLS option in the Zenoss email configuration UI.

Hopefully an SSL email option can be added in future version of Zenoss.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/63477#63477]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...