MIME, attachments, and few more things

Matt Ronge <mronge-ePFkAnfr6dRWk0Htik3J/[email protected]> Sun, 29 Jul 2007 21:09:01 -0700
Newsgroups gmane.mail.libetpan.user
Message-ID <[email protected]>
Hello,

In a few areas of my code I use the lower level libetpan functions to  
pull data from the IMAP server. However, once I've pulled the data I  
still want to be able to use some of the high level functionality  
because of it's convenience.

In particular, I do a mailimap_fetch, and then I use  
uid_list_to_env_list to convert my results to a mailmessage_list. In  
order to do this I've had to copy the uid_list_to_env_list code into  
my file. Would it be a good idea to expose some functionality in  
libetpan to make it easier to go from the lower level to the higher  
level? Would it be OK to expose uid_list_to_env_list?

Another low level to high level function I've had to copy as well, is
imap_flags_to_flags, would it be possible to expose something like this?

What are your thoughts on this Hoa?

Another question, I noticed that in a number of places,  
mailmime_fields_new_encoding(MAILMIME_MECHANISM_8BIT); is used. Why is  
8BIT always used? What if the client and server doesn't support 8BIT?

I've also been working on adding support in my code for sending  
attachments, and I'm a little bit confused. When I send text I use,  
mailmime_set_body_text, but now I want to send binary data. Can I  
still use mailmime_set_body_text? I can't seem to find another  
function to use in it's place. Of course, I also plan to use base64  
for my mime.

Finally, is there any code in etpanX or in libetpan that is used to  
determine what MIME type should be used for an attachment? IE: Like if  
the file is *.jpg then it will know to use image/JPEG.

Whew, that was a lot of questions.

Thanks in advance,
--
Matt Ronge

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/