Re: pop3: avoid fetching a mail twice

DINH Viet Hoa <[email protected]>
Newsgroups gmane.mail.libetpan.user
Message-ID <etPan.4275e356.33401e46.d6f@utopia>
Tom Schulte wrote :

> I'm playing around with the libetpan lib and can send and receive mail. But 
> how can i avoid to fetch a message twice from a pop3 server? I don't want to 
> delete the messages on the server.

(1) are you using the driver API ?
(mailstorage / mailfolder / mailmessage)

(2) or are you using the low-level POP3 API ?

1. the driver API will provide the cache for you.

2. in the low-level API, you can get the information of the message.

int mailpop3_get_msg_info(mailpop3 * f, unsigned int index,
                           struct mailpop3_msg_info ** result);

struct mailpop3_msg_info {
  unsigned int msg_index;
  uint32_t msg_size;
  char * msg_uidl;
  int msg_deleted;
};

msg_uidl will be a unique identifier for the message and it will be kept 
between two connections.

-- 
DINH Viet Hoa
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQBCdeRJ7w+pfAWHa3MRAp4iAJ9enWBR6x6Ezj5H5OUFg3X9yGcxDwCfb067
RJDPK5wJJZm4661EEjMCsCA=
=N0Kp
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.