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.
0.5.0Beta1 TLS support broken
Forum rules
Help us help you:
Help us help you:
- Tell us what system you run SABnzbd on.
- Adhere to the forum rules.
- Do you experience problems during downloading?
Check your connection in Status and Interface settings window.
Use Test Server in Config > Servers.
We will probably ask you to do a test using only basic settings. - Do you experience problems during repair or unpacking?
Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Re: 0.5.0Beta1 TLS support broken
The basics of the email module were written by someone
who was only briefly part of the team.
So in short, we're not very familiar with the module.
The comments in the SSMTP module clearly say that
a starttls should not be sent before opening the secure channel.
who was only briefly part of the team.
So in short, we're not very familiar with the module.
The comments in the SSMTP module clearly say that
a starttls should not be sent before opening the secure channel.
I'm not fully convinced that your variant works in all situations either.SMTP over SSL typical listens on port 465. Unlike StartTLS, SMTP over SSL
makes an SSL connection before doing a helo/ehlo. All transactions, then,
are done over an encrypted channel.
Re: 0.5.0Beta1 TLS support broken
Fair enough. Turns out that the source of my problem was a defunct RBL in my MTA.
You can safely disregard my post, though the SMTP over SSL standard seems to have settled on STARTTLS which is described in RFC3207, so a lot of that email.py code could be cleaned up if so desired.
You can safely disregard my post, though the SMTP over SSL standard seems to have settled on STARTTLS which is described in RFC3207, so a lot of that email.py code could be cleaned up if so desired.
Re: 0.5.0Beta1 TLS support broken
You could very well be right.
It's just that the current team is not very knowledgeable in this area
and we're a bit afraid to knock over existing functionality.
By definition it's a feature that's very hard to test,
given the amount of ISPs in the world.
We settle for gmail and our own ISPs.
I'll file your suggestions in ticket anyway, lest we forget it.
It's just that the current team is not very knowledgeable in this area
and we're a bit afraid to knock over existing functionality.
By definition it's a feature that's very hard to test,
given the amount of ISPs in the world.
We settle for gmail and our own ISPs.
I'll file your suggestions in ticket anyway, lest we forget it.