About merge-directive and SMTPConnection
Aaron Bentley
aaron.bentley at utoronto.ca
Sun Jun 17 22:36:53 BST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Adeodato Simó wrote:
> Hello John (CC'ing the list in case somebody wants to comment).
>
> I had a look at moving merge-directive to use SMTPConnection, and I
> found some issues:
>
> 1. SMTPConnection can only create MIME messages, and I have no idea
> whether the automatic merge tools can cope with that. Do you know
> if this can be an issue?
The only automatic merge tool that currently supports merge directives
is Bundle Buggy, and it actually expects to find merge directives in an
attachment.
> 2. create_message() wants an unicode body, but that can't happen
> because the diff is arbitrary 8bit data. So with the current
> SMTPConnection API, only send_text_and_attachment_email can be
> used, which would leave an empty first MIME part. Works, but sort
> of ugly.
We should make sure there's a way to create bytestring bodies, either by
accepting bytestrings in create_message or by having a second function
for creating messages. Since it's usually desirable to use unicode
bodies, it might make sense to have create_bytestring_message as a
second function.
> 3. With the current API, it seems clumsy not to send the mail from
> where it's created, since otherwise you have to pass two objects
> around, the smtp object, and the message. But this changes the
> behavior of MergeDirective.to_email(), so that one needs to get
> deprecated, and a new function introduced.
>
> Do you have any comments on this? Personally I would bring into bzrlib a
> reduced SMTPConnection class, only with code for:
>
> 1. reading the config for server/user/password
> 2. private functions for connecting, authenticating, etc.
> 3. a public method for sending a Message(), extracting the from and to
> addresses from said Message, instead of passing them around as
> arguments
I would not want to lose the functionality in
SMTPConnection._basic_message. I don't care how it's done, I just want
to be able to specify a unicode from string, and not worry about
encoding it correctly.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGdal10F+nu1YWqI0RAhgBAJ4rg0ERFSPpgQuiej0Ow0Quu+WRHACfZ781
efhoqMe3WVGUZUhQE+oJwCo=
=+1Ye
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list