[MERGE] An EmailMessage class for bzrlib (v0)

Aaron Bentley aaron.bentley at utoronto.ca
Mon Jun 25 14:47:27 BST 2007


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

Adeodato Simó wrote:
> Here is my proposed EmailMessage class for bzrlib. I think I addressed all
> the comments raised in the [RFC] thread.

I don't think you've addressed my comment that add_text_attachment is
overgeneral.  In order to support two usages, you're contorting the
meaning of "text".  I think it's better to have two methods-- one for
each usage.

add_text_attachment <- takes unicode only, sets type to text/plain,
encoding to utf-8

add_patch_attachment <- takes bytestrings only, sets type to
text/x-patch (or perhaps text/x-diff), and sets no encoding.

(Actually, we may not even need add_text_attachment.)

Also, it would make sense to use this for PQM, but I'm not sure whether
PQM submit messages can be MIME multipart.  I guess we can wait and see.


>   * Aaron, I agree to adding the EmailMessage.send() method you
>     proposed; but since it would need SMTPConnection, which is not yet
>     merged, I'm delaying its inclusion until then (*hint*).

Done.

>   * I'm setting the User-Agent of created mails to 'Bazaar ($VERSION)';
>     the original SMTPConnection set it to 'bzr/$VERSION'. I asked on IRC
>     about which one people preferred, and John suggested to take it to
>     the list.

Seems fine to me.  Somewhat matches what we're doing with format markers.

> +            # This does not put the name part in double quotes if it
> +            # contains forbidden unquoted chars, eg. a dot. TODO?
> +            return '%s <%s>' % (Header.Header(safe_unicode(user)), email)

Is there any harm in always double-quoting?  That's what I do, even
though my name contains no forbidden characters.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGf8dv0F+nu1YWqI0RArq1AJwMG6C4l6R0ZKN+FRwpKxV50qQVwQCeLVBk
L4aiB9k6vUrCYEh8s3mRhbs=
=gqV7
-----END PGP SIGNATURE-----



More information about the bazaar mailing list