Re: Calls to camel_mime_message_set_* to send mails



Thanks, your patch is applied

On Fri, 2006-11-03 at 19:37 +0100, Sergio Villar Senin wrote:
> Philip Van Hoof wrote:
> > On Thu, 2006-11-02 at 15:45 +0100, Sergio Villar Senin wrote:
> >> Hi,
> >>
> >> I realized that when you're using tinymail with the camel backend, and
> >> you want to send a message with tny_transport_account_send(), this
> >> function does not call any of the camel_mime_message_set_* stuff. I know
> >> that for example Evolution does it in the UI side (for example in the
> >> e_msg_composer_hdrs_to_message_internal() call), but don't you think
> >> that it would be very useful to have all these stuff inside
> >> tny_camel_transport_account_send?
> >>
> >> I mean, the client of tny_transport_account_send could do it, but why
> >> force it to fill both the TnyMessage and the CamelMimeMessage objects?
> > 
> > Perhaps you are indeed right. I have not yet developed a lot on the
> > sending of messages part of tinymail.
> 
> I was wrong though :). All these calls are currently in the code of
> Tinymail. The problem was the next, TnyCamelMsg creates a
> CamelMessageInfo when it's created and TnyCamelHeader could create
> another different if you call any of the
> tny_camel_header_set_(to,from...) methods without calling before
> _tny_camel_header_set_camel_mime_message with the same object that is
> referenced by TnyCamelMsg.
> 
> One possible fix is the attached patch. This patch just adds the call to
> _tny_camel_header_set_camel_mime_message() inside the
> tny_camel_msg_set_header() call. Note that if you're developing some app
> with tinymail you must use the calls in a particular order. This is the
> right one:
> 
> tny_msg_set_header (msg, header);
> tny_header_set_from (header, from);
> tny_header_set_to (header, to);
> .....
> 
> because if you do:
> 
> tny_header_set_from (header, from);
> tny_header_set_to (header, to);
> ....
> tny_msg_set_header (msg, header);
> 
> then you'll loose all your sets to the header and get a funny warning:
> g_warning ("Strange behaviour: Overwriting existing message info");
> 
> 
> Br.
> 
> PD: the patch also includes a fix to a problem in the function
> _foreach_email_add_to_inet_addr. If you call this function with a NULL
> email argument then strtok_r will give you a very weird outcome.

-- 
Philip Van Hoof, software developer at x-tend 
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
work: vanhoof at x-tend dot be 
http://www.pvanhoof.be - http://www.x-tend.be




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]