Michael Leupold | 1 Apr 2006 17:21
Picon

Exporting Low-Level API to a DLL using MSVC

Hi,

I've recently begun looking into libetpan for coding my own little 
application. As I want to try to develop some disconnected imap functionality 
I'll probably be using the low-level imap api. At the moment libetpan barely 
exports any low-level symbols when compiling a dll using msvc. Is there a 
special cause to this or is just noone using the low-level api on windows?

Regards,
Michael

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
DINH Viet Hoa | 1 Apr 2006 23:52
Picon
Favicon

Re: Exporting Low-Level API to a DLL using MSVC

Michael Leupold wrote :

> I've recently begun looking into libetpan for coding my own little 
> application. As I want to try to develop some disconnected imap functionality 
> I'll probably be using the low-level imap api. At the moment libetpan barely 
> exports any low-level symbols when compiling a dll using msvc. Is there a 
> special cause to this or is just noone using the low-level api on windows?

It is just that no one is using the low-level API on windows since 
libetpan was first designed for Unix flavour.

--

-- 
DINH V. Hoa
Michael Leupold | 2 Apr 2006 01:06
Picon

Re: Exporting Low-Level API to a DLL using MSVC

Am Samstag, 1. April 2006 23:52 schrieb DINH Viet Hoa:
> Michael Leupold wrote :
> > I've recently begun looking into libetpan for coding my own little
> > application. As I want to try to develop some disconnected imap
> > functionality I'll probably be using the low-level imap api. At the
> > moment libetpan barely exports any low-level symbols when compiling a dll
> > using msvc. Is there a special cause to this or is just noone using the
> > low-level api on windows?
> It is just that no one is using the low-level API on windows since
> libetpan was first designed for Unix flavour.

As I'm using it anyway, should I make my modification available? As I'm pretty 
new to windows programming I have no idea if this would bloat the executable 
using the dll... the lib grows. You could also use defines to enable the 
different low-level apis if you need them like
#ifdef WINDOWS_DLL
#define EXPORT_LOWLEVEL_IMAP LIBETPAN_EXPORT
#endif

or something similar.

Regards,
Michael

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
(Continue reading)

DINH Viet Hoa | 2 Apr 2006 10:22
Picon
Favicon

Re: Exporting Low-Level API to a DLL using MSVC

Michael Leupold wrote :

> As I'm using it anyway, should I make my modification available? As I'm pretty 
> new to windows programming I have no idea if this would bloat the executable 
> using the dll... the lib grows. You could also use defines to enable the 
> different low-level apis if you need them like
> #ifdef WINDOWS_DLL
> #define EXPORT_LOWLEVEL_IMAP LIBETPAN_EXPORT
> #endif

you can make your modifications available.
I don't need any EXPORT_LOWLEVEL_IMAP things.
You can write a patch to enable low-level API always.

Thanks,

--

-- 
DINH V. Hoa,

"c'est un peu comme les crampons au foot au début t'as des ampoules
    et après non" -- sunZ
DINH Viet Hoa | 2 Apr 2006 11:32
Picon
Favicon

Re: help extracting html content from mail

Marko Ivancic wrote :

> I'm writing a html mail viewer with gtkmozembeded widget. I have a 
> problem to get html content of a message.
> 
> What is a simple way to get the HTML contest of a message  (if the 
> message contains it)

get the MIME structure of the message.

- display multipart/mixed in the given order.
- display multipart/parallel in any order.
- display one sub-part of the multipart/alternative (for example, if 
    there is an HTML part, display it)

--

-- 
DINH V. Hoa,

"c'est un peu comme les crampons au foot au début t'as des ampoules
    et après non" -- sunZ
DINH Viet Hoa | 2 Apr 2006 11:14
Picon
Favicon

Re: attachment from header

Marko Ivancic wrote :

> It is possible  to get  attachment information (if  the message has an 
> attachment )  from  the message headders. Fo example
> with  the function
> 
> mailfolder_get_envelopes_list(,)  //get the parsed headers

it is not possible.
You need to retrieve the entire MIME structure before telling the use 
whether the user should consider if there are attachments or not.
(note that for example a multipart/alternative part with text/plain 
text/html does not contain an attachment).

--

-- 
DINH V. Hoa,

"c'est un peu comme les crampons au foot au début t'as des ampoules
    et après non" -- sunZ
DINH Viet Hoa | 2 Apr 2006 11:28
Picon
Favicon

Re: mailimap_lsub problem

Marko Ivancic wrote :

> I use mailimap_lsub to retrive mail folders from IMAP server like this:
> 
> mailimap_lsub(imap, "", "*",&list);  // (the  same way as etpan does)
> 
> But in the result list there are folders that can not be connected for 
> example:
> 
> mail/
> mail
> mail/sent/
> mail/inbox
> 
> The folder: mail/ and mail (is the same folder) can not be connected. 
> Is  there any way to find out which folder can be connected and which not.

struct mailimap_mailbox_list {
  struct mailimap_mbx_list_flags * mb_flag; /* can be NULL */
  char mb_delimiter;
  char * mb_name; /* != NULL */
};

enum {
  MAILIMAP_MBX_LIST_SFLAG_ERROR,
  MAILIMAP_MBX_LIST_SFLAG_MARKED,
  MAILIMAP_MBX_LIST_SFLAG_NOSELECT,
  MAILIMAP_MBX_LIST_SFLAG_UNMARKED
};

(Continue reading)

DINH Viet Hoa | 2 Apr 2006 11:27
Picon
Favicon

Re: how delete a message

????????? wrote :

> I download libetpan-0.42 and compile without errors.
> View test sample fetch-attachment, how i can delete message affter i
> sucessful get all attachment from message? (-d pop3)
> I read API and understand that i must before mailmessage_free(msg):
>  - sets flag that message is deleted (don't now how)
>  - call mailsession_expunge_folder(folder->fld_session)  to delete all marked.
> mailmessage_get_flags(msg, &flags); // Only get's flags but how mailmessage_set_flags?

if you got the message using _get_messages_list(), then
_fetch_envelopes_list(), you don't need mailmessage_get_flags()..

Do the following :

{
  mailmessage * msg

  /* get the message */

  msg->msg_flags->fl_flags = msg->msg_flags->fl_flags &
    MAIL_FLAGS_DELETED;

  mailmessage_check(msg);

  /* do multiples messages flags modifications ... */

  mailfolder_check(msg);
}

(Continue reading)

Marko Ivancic | 2 Apr 2006 13:19
Picon

Re: mailimap_lsub problem

Tnx Mr. Dinh

I always get the mb_flag pointer value as NULL. I have 7 folders on an 
imap server only one of these is not NULL but is a selectable folder ( a 
folder I can connect on).

Mybe is a server side problem ??

Tnx,
By
Marko

DINH Viet Hoa wrote:
> Marko Ivancic wrote :
>
>   
>> I use mailimap_lsub to retrive mail folders from IMAP server like this:
>>
>> mailimap_lsub(imap, "", "*",&list);  // (the  same way as etpan does)
>>
>> But in the result list there are folders that can not be connected for 
>> example:
>>
>> mail/
>> mail
>> mail/sent/
>> mail/inbox
>>
>> The folder: mail/ and mail (is the same folder) can not be connected. 
>> Is  there any way to find out which folder can be connected and which not.
(Continue reading)

chris harward | 3 Apr 2006 08:51
Picon

building libetpan for windows

Hi all,
 
I'm trying to build libetpan for my windows app, I've tried using .NET 2005 and 2003. It compiles okay, but I find that some of the functions mentioned in the docs (such as mailfolder_get_messages_list) are not in the .lib produced (I get a LNK2001 error when I try to link to them). For instance the following code gives an error for the mailfolder_get_messages_list function call, but none of the others cause an error. Does anyone know what I might have done wrong?
 

struct

mailstorage *storage = mailstorage_new(NULL);

struct mailfolder *folder;

struct mailmessage_list *msg_list;

imap_mailstorage_init(storage,

"myserver.name.com", 0,

NULL, CONNECTION_TYPE_PLAIN, IMAP_AUTH_TYPE_PLAIN,

"user.name", "pswd", 0, 0);

mailstorage_connect(storage);

folder = mailfolder_new(storage,

"INBOX", NULL);

mailfolder_connect(folder);

mailfolder_get_messages_list(folder, &msg_list);

m_listBox.InsertString(2, (LPCTSTR)

"contents of mailbox user.name:");

int count = carray_count(msg_list->msg_tab) + 3;

for (int i = 3; i < count; i++)

{

mailmessage *msg = (mailmessage*)carray_get(msg_list->msg_tab, i);

char *res;

size_t x;

mailmessage_fetch_header(msg, &res, &x);

m_listBox.InsertString(i, (LPCTSTR)res);

}

UpdateData();

mailmessage_list_free(msg_list);

mailfolder_disconnect(folder);

mailstorage_disconnect(storage);

mailstorage_free(storage);

 

 


Gmane