PQM

pqm-submit is sending messages pqm doesn't understand

Bug #160530 reported by John A Meinel
2
Affects Status Importance Assigned to Milestone
Bazaar PQM Plugin
Fix Released
Critical
John A Meinel
PQM
Confirmed
Medium
Unassigned

Bug Description

The PQM bot is not fully e-mail/MIME aware. It only understands raw UTF-8 subject lines. Not properly encoded e-mail ones.

As an example is bzr.dev 2972 which has a desired message of:
  (Adeodato Simó) show (possibly dotted) revnos in `bzr tags`, allow to sort them by time

However, the actual commit message was:
  (Adeodato =?UTF-8?B?U2ltw7MpIHNob3cgKHBvc3NpYmx5IGRvdHRlZCkgcmV2?=
     =?UTF-8?B?bm9zIGluIGBienIgdGFnc2AsIGFsbG93IHRvIHNvcnQgdGhlbSBieSB0aW1l?=

Note that this is a proper email subject, and decodes correctly, but PQM doesn't do the decoding.

Technically, this could be considered a bug in PQM, but in the short term, pqm-submit needs to send the right data.

Related branches

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

Working on it, will be committed to trunk in a second (and pushed to the 0.92 branch)

Changed in bzr-pqm:
assignee: nobody → jameinel
importance: Undecided → Critical
milestone: none → 0.92
status: New → Fix Committed
status: Fix Committed → Fix Released
Revision history for this message
John A Meinel (jameinel) wrote :

Should this be a different bug which is just that PQM doesn't properly conform to the e-mail Subject spec?

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

It does look like a bug that the entire subject line from the first non-ASCII character got escaped. Is that an issue with the email module, or bzrlib?

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

Well, there are 2 bits.

1) It technically could have done:
    "(Adeodato =?UTF-8?B?U2l=) show (possibly dotted) revnos in `bzr tags`, allow to sort them by time"

And only encoded the single character that was not ascii.

I think the reason the whole string was encoded was because of the email module.

In fact, I'm surprised that the whole string wasn't one =?UTF-8?B?....=
I'm guessing that python2.4 would have done that, because that is the code I've looked at more.

In fact, with 2.4 I get
>>> msg = bzrlib.email_message.EmailMessage('joe@foo', ['joe@foo'], u'Testing \xe5')
>>> str(msg._headers['Subject'])
'=?utf-8?q?Testing_=C3=A5?='

This is because the quoted printable was shorter than the base64 encoded form. But if you put more characters in, that will eventually shift.

>>> msg = bzrlib.email_message.EmailMessage('joe@foo', ['joe@foo'], u'Testing \u062c\u0648\u062c\u0648')
>>> str(msg._headers['Subject'])
'=?utf-8?b?VGVzdGluZyDYrNmI2KzZiA==?='

2) PQM doesn't support any sort of quoting anyway. So regardless we need to send a raw UTF-8 Subject line, because that is what PQM expects.

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

I should also make it clear that officially to conform to the Email RFC 2231 we shouldn't be sending anything but ASCII or the properly =?UTF-8?...= encoded forms.

Which is what we upgraded bzrlib to do. But means that we need to downgrade pqm-submit, because pqm does not accept properly formed emails.

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 160530] Re: pqm-submit is sending messages pqm doesn't understand

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

John A Meinel пишет:
> Well, there are 2 bits.
>
> 1) It technically could have done:
> "(Adeodato =?UTF-8?B?U2l=) show (possibly dotted) revnos in `bzr tags`, allow to sort them by time"

Sorry guys about this subject line. It my fault and my thunderbird.
I generate that e-amil by hands and send via Thunderbird.
I don't use pqm-submit plugin.

Sorry again :-(
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHMVcJzYr338mxwCURAqDhAJ4hh/DpAhDYqeh4zZ7meARypwtp8gCeKaAn
OEfn0nrjLi2k5kkQZzhe5/w=
=g1wE
-----END PGP SIGNATURE-----

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 160530] Re: pqm-submit is sending messages pqm doesn't understand

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Belchenko wrote:
> John A Meinel ?8H5B:
>> Well, there are 2 bits.
>
>> 1) It technically could have done:
>> "(Adeodato =?UTF-8?B?U2l=) show (possibly dotted) revnos in `bzr tags`, allow to sort them by time"
>
> Sorry guys about this subject line. It my fault and my thunderbird.
> I generate that e-amil by hands and send via Thunderbird.
> I don't use pqm-submit plugin.
>
> Sorry again :-(

Well, it is the same problem. But interestingly it was T-bird generating a
"correct but wrong for PQM" message.

It just happened to happen the day after I updated pqm-submit to make the same
mistake.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHMfzqJdeBCYSNAAMRAiNIAKCjqwyHWpq3I5Zz0+FTBgS2emQgKACfaaxM
LLDxzYqzfyVsamfbwzumJos=
=6ttl
-----END PGP SIGNATURE-----

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 160530] Re: pqm-submit is sending messages pqm doesn't understand

On Wed, 2007-11-07 at 17:59 +0000, John A Meinel wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Alexander Belchenko wrote:
> > John A Meinel ?8H5B:
> >> Well, there are 2 bits.
> >
> >> 1) It technically could have done:
> >> "(Adeodato =?UTF-8?B?U2l=) show (possibly dotted) revnos in `bzr tags`, allow to sort them by time"
> >
> > Sorry guys about this subject line. It my fault and my thunderbird.
> > I generate that e-amil by hands and send via Thunderbird.
> > I don't use pqm-submit plugin.
> >
> > Sorry again :-(

So Alexander, what can we do to pqm-submit, to make it more usable for
you - to make it your default choice to send merges?

-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Revision history for this message
Dan Watkins (oddbloke) wrote :

I can't reproduce this. If someone finds a way to do it, reopen the bug.

Changed in pqm:
status: New → Incomplete
Revision history for this message
John A Meinel (jameinel) wrote :

pqm-submit has been crafted to no-longer send proper email subjects, I'm happy to switch it back if you need it for testing.

Basically, I hacked pqm-submit to workaround the problem with PQM.

Revision history for this message
Dan Watkins (oddbloke) wrote :

I've found a way. Bug reopened. I'm going to have a look at this now.

Changed in pqm:
assignee: nobody → daniel-thewatkins
importance: Undecided → Medium
status: Incomplete → Confirmed
Dan Watkins (oddbloke)
Changed in pqm:
assignee: Daniel Watkins (daniel-thewatkins) → nobody
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.