About merge-directive and SMTPConnection
Adeodato Simó
dato at net.com.org.es
Sun Jun 17 21:56:22 BST 2007
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?
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.
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
All of that with proper catching of exceptions. :-)
The rest of the code of the original SMTPConnection from bzr-email can
be either left there, of brought to bzrlib as well in a way that is
still useful to merge-directive; though I think merge-directive's needs
are few enough that it can be done directly.
Thoughts?
--
Adeodato Simó dato at net.com.org.es
Debian Developer adeodato at debian.org
Hay quien sueña con la alquimia
que haga del vicio virtud
-- Luis Eduardo Aute, Giraluna
More information about the bazaar
mailing list