To support a dynamic email account (one with new messages and deleted messages) and to implement the Idle and Notify commands, I need to handle server notifications.  What I plan to do is implement a monitor loop which will do a readline on the input from the server.  Each new line will be tested to see if it is a notification.  If so, the appropriate action will be taken.  If it's not a notification, it will be printed to a buffer stream. Currently, commands are directly sent to the server socket and replies are read directly from the same socket.  In the new approach, replies will be read from the buffer.

One complication is that I must ensure that all the CRLFs in the buffer must remain intact.  Another complication is that I cannot just do a readline on a blocking stream.  There maybe some time between notifications, which would normally cause the readline to timeout.  Idle and Notify commands can wait for 20 minutes or more.

Comments? Suggestions?  I'd really appreciate advice on the best way to handle this.


On 2017-09-23 09:09 PM, Tony Morehen wrote:
Just a quick update on an Imap class.  The following methods have been implemented and, for the most part, tested:

Abort, AddMessageFlags, Authed, BuildSequenceSet, Capabilities,
CleanUpMailBoxList, Connect, CopyMessage, CopyMessages, CreateMailbox, Debug,
DeleteMailbox, DeleteMessage, DeleteMessages, Encrypt, Exec, Expunge,
FindValue, GetMessage, GetMessageFlags, Host, LSub, List, ListMailboxes,
ListSubscribedMailboxes, Logout, MailboxInfo, MailboxStatus, MoveMessage, MoveMessages, Noop, Password, Port, RemoveMessageFlags,
RenameMailbox, Search, SelectMailbox, SetMessageFlags, User, Welcome

The testing has been done on a static email account.  As a result, copy, move and delete messages have not been properly tested. I'll follow up on that in another message.




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to