Make STARTTLS and AUTH work better

Bug #150834 reported by James Henstridge
2
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

Revision history for this message
Robert Collins (lifeless) wrote :

Really should fix the bzrlib smtp_connection module and change bzr-pqm to get rid of its duplicate (the original) copy.

Revision history for this message
John A Meinel (jameinel) wrote :

Your changes sound great, I'd be happy to merge them.

We just switched the ownership over to being owned by the global 'bzr' group, because it seemed superficial to have a group for just bzr-pqm. I think I originally did it because it seemed cleaner. But it just means one more group someone needs to join.

I'm happy to merge it in, though it should be pulled into bzr core and bzr-pqm updated to use the bzr core's version.

I don't see an associated branch, or any sort of patch. Any chance you can push up your own branch, and associate it with this bug?

(bzr register-branch --link-bug 150834 ...)

Revision history for this message
James Henstridge (jamesh) wrote :

The branch is linked to the bug.

I've submitted a bzr patch to improve bzrlib.smtp_connection, and will rework the bzr-pqm patch to use that instead.

Revision history for this message
James Henstridge (jamesh) wrote :

The branch has been updated to use bzrlib's internal email message and SMTP code. Things should be no worse than they are now with the branch merged, and should fix this bug once the bzrlib change has been merged.

John A Meinel (jameinel)
Changed in bzr-pqm:
assignee: nobody → jamesh
importance: Undecided → Medium
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.