Re: Getting received date of a message

"DINH Viêt Hoà" <[email protected]> Thu, 13 Nov 2008 12:42:08 +0100
Newsgroups gmane.mail.libetpan.user
Message-ID <[email protected]>
On Thu, Nov 13, 2008 at 12:03 PM, Tor Langballe <[email protected]> wr=
ote:
> Hello, couldn't find anything about this in the forum, though it was
> hard to search...
>
> I'm trying to get the date an email was received by the server (IMAP).
> This is for sorting, as some users have messed up clocks and a
> received date will be more reliable.
>
> Is there anything in the API to do this?
>
> The Received:  field contains such information for each transfer of
> the email, is it parsed?
>
> I tried the Resent-date: field, but it seems to be empty.

Hello,

in order to get the date received by the server, you have to use the
INTERNALDATE stuff of IMAP.
To do this, you have to use the low-level API of IMAP.

in libetpan/src/low-level/imap

You have to perform a FETCH (mailimap_fetch) command with the specific
INTERNALDATE (mailimap_fetch_att with type =3D
MAILIMAP_FETCH_ATT_INTERNALDATE).
Then, in the "struct mailimap_msg_att_static" part of the returned
structure, you'll get this.

see mailimap_types.h, mailimap_types_helper.h and mailimap.h

Regards,

-- =

DINH Vi=EAt Ho=E0

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great priz=
es
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=3D100&url=3D/