0 votes
by (200 points)

Is there a way to only pull 500 messages per check with POP3? Using VB for Reference. Extremely large mailbox so can't pull all messages at once.

Thanks
Nick

Applies to: Rebex Secure Mail

1 Answer

0 votes
by (73.6k points)

Please note that POP3 protocol is very old and paging was never introduced in it. The POP3 was intended to synchronize remote POP3 mailbox with user's local mailbox copy the most easiest way.

The suggested routine is like this:

  1. get list of unique ids in remote mailbox
  2. compare retrieved list with local mailbox copy
  3. download missing mails in local mailbox sequentially

Some kind of database is required on client to hold information about already downloaded mails (unique ids) and to solve situations for deleted mails on client/server.

To get list of unique ids from server use:

pop3.GetMessageList(Pop3ListFields.UniqueId | Pop3ListFields.SequenceNumber);

You may also find GetMessageSequenceNumber() method helpful.

Then instead paging, download mails sequentially using the GetMessage() method.
Alternatively use GetMessageInfo(Pop3ListFields.FullHeaders) method if you don't want to download whole message (only headers such as From, To, CC, Subject, etc. are received).

...