[haiku-commits] Re: r40399 - in haiku/trunk/src/add-ons/mail_daemon/inbound_protocols/imap: . imap_lib

  • From: Clemens <clemens.zeidler@xxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 10 Feb 2011 16:06:04 +1300

On Wed, 09 Feb 2011 14:54:18 +1300, <clemens.zeidler@xxxxxxxxxxxxxx> wrote:

Author: czeidler
Date: 2011-02-09 02:54:18 +0100 (Wed, 09 Feb 2011)
New Revision: 40399
Changeset: http://dev.haiku-os.org/changeset/40399
...
Log:
Map one or more server mailboxes two a local directory. All subscribed mailboxes are fetched automatically and populated under the root account folder. On startup the local copy is synced with the server, means all local changes are rejected. (We should think about store offline changes and apply them when online) Also the read flags are synced with the server. This makes it easy to have the same mailbox state on different machines.

Messages could be deleted by delete them form the folder (not when moving them to trash) This maybe needs some more thoughts but its a save solution. One problem with moving it to trash is that you also want to have the option to restore it again. If it is a header only messages and you delete it from the server you lose the body part. Complete messages could theoretically be append to the mailbox again when restoring the mail form trash. Append is commented out though...

An solution for the delete problem would be to move the message to a trash folder on the server. Moving mails on the server is not implemented yet, though.

You can subscribe or unsubscribe to a mailbox using the imap pref panel. The settings are written to the server and are not stored locally.

Add some helper classes which could also be used for POP and SMTP:
ServerConnection: abstract ssl or socket connection
ConnectionReader (still a bit IMAP specific but could be easily separated IMHO): read complete lines or a bunch of data more efficient. Old implementation did it byte by byte, this class read data in bunches and buffer the left over for the next request...

Ah forgot to mention: messages are fetched and deleted in real time if the server supports it (IDLE). Also the status flag should be live but for e.g. gmail does not support it... So its no bug if "check for new mails" does nothing for an imap account, the client is watching the server all the time.

        Clemens

Other related posts: