Make STARTTLS and AUTH work better
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar PQM Plugin |
Fix Released
|
Medium
|
James Henstridge |
Bug Description
Due to annoying hotel internet, I tried switching bzr-pqm over to Canonical's SMTP server, which requires TLS and authentication to send messages. However, the plugin would not talk to the server.
There appears to be a few problems:
* the server won't accept a STARTTLS command until the client has been told that it is supported (from the EHLO request).
* the server does not include the AUTH extension in the EHLO response until after TLS has been initialised.
So I've changed the SMTP code to do the following:
1. Connect to server
2. Send EHLO
3. If (2) fails, send HELO. If that fails, exit
4. If STARTTLS is a supported extension, send STARTTLS. If that fails exit.
5. After switching to TLS, issue an EHLO (if the server did not support EHLO, we wouldn't know that STARTTLS was supported).
6. Perform authentication as before
7. send email
This should also fix the problem of servers that don't like receiving STARTTLS unexpectedly that was mentioned in bug 76239.
It looks like I can't commit this myself any more, since the mainline branch ownership was changed for some reason ...
Related branches
Changed in bzr-pqm: | |
assignee: | nobody → jamesh |
importance: | Undecided → Medium |
status: | New → Fix Released |
Really should fix the bzrlib smtp_connection module and change bzr-pqm to get rid of its duplicate (the original) copy.