0.5.0Beta1 TLS support broken
Posted: December 3rd, 2009, 7:41 am
I was having problems with sabnzbd sending email after the upgrade from 0.4 to 0.5. I did some debugging and from what I can tell, the root of the problem is that the sabnzbd.utils.ssmtplib module is not sending a STARTTLS before it tries to start an SSL session.
I'm not 100% sure what that module is for, since it seems like the smtplib module in Python already can differentiate a mail server with TLS support from one without it, in the smtplib.starttls() function. I hacked the email.py code a bit and got it to work properly, without needing the sabnzbd.utils.ssmtplib module. I have tested it on Postfix with and without TLS enabled and it seems to work.
It is entirely possible that I have overlooked something with that module, so please don't flame me too much if that is the case. I am a Ruby programmer who is learning Python, so a code review from someone who knows more than I do would be a good idea.
diff attached.
I'm not 100% sure what that module is for, since it seems like the smtplib module in Python already can differentiate a mail server with TLS support from one without it, in the smtplib.starttls() function. I hacked the email.py code a bit and got it to work properly, without needing the sabnzbd.utils.ssmtplib module. I have tested it on Postfix with and without TLS enabled and it seems to work.
It is entirely possible that I have overlooked something with that module, so please don't flame me too much if that is the case. I am a Ruby programmer who is learning Python, so a code review from someone who knows more than I do would be a good idea.
diff attached.