Email client question

BlitzPlus Forums/BlitzPlus Programming/Email client question

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

Good point... I guess you're limited to scanning the headers. From what I remember reading, POP3 servers don't have an awful lot of capabilities, anyway. Here's the POP3 command summary from the relevant RFC (official documented protocol):


9. POP3 Command Summary

Minimal POP3 Commands:

USER name valid in the AUTHORIZATION state
PASS string
QUIT

STAT valid in the TRANSACTION state
LIST [msg]
RETR msg
DELE msg
NOOP
RSET
QUIT

Optional POP3 Commands:

APOP name digest valid in the AUTHORIZATION state

TOP msg n valid in the TRANSACTION state
UIDL [msg]

POP3 Replies:

+OK
-ERR

Note that with the exception of the STAT, LIST, and UIDL commands,
the reply given by the POP3 server to any command is significant
only to "+OK" and "-ERR". Any text occurring after this reply
may be ignored by the client.



Ah... the UIDL command might do it, but that's optional for POP3 servers to support, though most probably do by now. You'd presumably have to check it gets a valid response, and default to header scanning if not available. From a quick Google, it looks like you pass a message number and it returns the unique ID, or pass nothing for (all?) unique IDs.

Some guy in this thread says:


This isn't actually the case. POP3 has extended command UIDL, which returns you a list of unique identifiers (just like LIST returns the sizes of messages). After this, you only need to check the UID with stored UIDs of the messages you've already downloaded. This is quite fast even with thousands of messages.

The downside is that not all servers provide UIDL-command since it's not required by the standard. If this is the case, the only solution is to download message headers (using command like TOP) only and comparing them to headers already received. This takes somewhat longer
(but not as long as it'd take to download the whole messages) and isn't as reliable as using UIDs.