[Gambas-devel] [RFC] Gambas implementation of the pop3 protocol

Benoît Minisini gambas at ...1...
Sun Aug 26 05:18:29 CEST 2012


Le 26/08/2012 04:27, Sebastian Kulesz a écrit :
>
> Please provide any feedback!
>

You should better use an anonymous reference (Object) instead of a 
Variant. It's faster.

If TCPClient and SSLClient share the same interface, they should inherit 
a common class. Then the Client variable will have a static datatype, 
and method calls are far faster (direct access instead of symbol table 
lookup).

The public symbols are not always well chosen or written ("WelcomeMSG", 
"NOOP"), or incorrect ("Retrive" instead of "Retrieve").

I don't know what is the use of these static functions with long names 
and underscore in it.

You should use underscore in method names only for event handlers.

Maybe you should be able to create an interface with higher level that 
hides all the POP3 commands. In a few words, a Pop3Client user mainly 
wants these features:
- The number of messages to read. (STAT)
- The size of all theses messages. (STAT)
- The size of one message. (LIST x)
- One specific message. (RETR x)
- Delete one message. (DELE x)
- Undelete all messages. (RSET)
- The beginning of a message. (TOP x n)

All that could be done with well-named method, the _get special method...

- The number of messages to read. -> .Count
- The size of all theses messages. -> .Size
- The size of one message. -> [x].Size
- One specific message. -> [x].Text
- Delete one message. -> [x].Delete()
- Undelete all messages. -> .Reset()
- The beginning of a message. -> No idea yet!

Authentication should rely on Pop3Client properties set before starting 
the session.

And encryption should be defined by an integer property with constants 
for each encryption method, like in SmtpClient.

MyPop3Client.User = "xxx"
MyPop3Client.Password = "yyy"
MyPop3Client.Encrypt = Net.SSL

The session should start automatically, as soon as we want a 
"transaction" action.

The QUIT command should be able to be called explicitely (Quit or better 
Close method), and implicitely when the MyPop3Client object is freed.

Once all that is done, the Pop3Client should be put in the same 
component that SmtpClient, and the component should be renamed gb.mail 
(or something like that).

What do you think?

-- 
Benoît Minisini




More information about the Devel mailing list