I missed the fact that the BDataIO based Unflatten didn't handle this.
Restore the code from the recently removed buffer-based unflatten, so
it's possible to pass a message by area again.
* We now also maintain a mail index -> UID array in IMAPMailbox.
* Instead of fetching the message entries by a fixed range of UIDs, we use the
message count, and get the entries by index.
* Likewise, in FetchHeadersCommand, we now get a list of UIDs rather than a
range. This makes it possible to only download exactly the headers we want.
* Extended FetchCommand to be able to dynamically build a sequence list from
a list of UIDs.
* Besides the suboptimal body fetching (one at a time, due to holes in the
IMAP specification), we should now be able to retrieve the messages with
pretty much optimal performance, while retaining an acceptable responsiveness
to user requests.
* Changed the way the attributes are written to make sure that everything
that can be written once is in fact written just once.
* The rename code in BMailProtocol::_ProcessFetchedHeader() was broken,
and caused the hang of the last commit.
* BMailFilter::HeaderFetched() now only alters the entry_ref, and returns
B_MOVE_MAIL_ACTION to move a mail.
* Instead of potentially moving the file around several times, the
BMailProtocol now takes care of carrying out the filter action just once,
including trying to make the file name unique.
* This also allows the IMAP add-on to know the final location of the mail,
and thus downloading a message actually works.
* However, with my test inbox, it currently hangs, and a current Debugger does
not work on my older system -- I guess I need to update.
* Replaced the duplicated space mechanism within the "HaikuMailFormatFilter"
that is substantially faster, and handles all whitespace, not just spaces.
It will also replace tabs with spaces.
* This will be used to solve the TODO in CheckMailboxesCommand::Process()
when the initial message sizes/flags are retrieved.
* Also fixed imap_tester build.
* Most things are in place now, we just try to download the body to the
wrong file, as the final location is currently unknown.
* Added local only kPartialMessage flag for mails, but it's not being
used yet.
* Refactored new message retrieval a bit, so that the notification strings
aren't duplicated.
* The daemon now waits 30 seconds before doing the first mail check.
* CheckMailboxesCommand, and FetchHeadersCommand now inherit from SyncCommand
which will prevent new CheckMailboxesCommand to be enqueued.
* FetchHeadersCommand now only retrieves up to kMaxFetchEntries headers at
once. This gets the same TODO about scaling as the limit in
CheckMailboxesCommand when fetching the flags/UIDs. Since we already read
all new UIDs at that point, we could easily do better there, though.
* We now use the account name as destination directory.
* Turns out that an empty string is written as destination which worked
around the GetString() solution.
* In this case, fSize would have been set incorrectly, ignoring the error
completely, but open the possibility to read from uninitialized or even
unmapped memory.
* Was completely missing so far.
* Fixed bug in decoding that handled the "&-" sequence incorrectly.
* Added small test application that should easily be convertible to
a unit test.
* There is now a CheckSubscribedFoldersCommand that is issued on the main
connection that triggers everything.
* The new CheckMailboxesCommand divides the new mail check into several
portions, and requeues itself until the next step, ie. the
FetchHeadersCommand.
* The headers of the new mails are downloaded, but nothing is done with
them yet.
* The actual check for the new mails doesn't scale that well yet, not sure
how to properly do this without having to rely on the mail indices. Might
be sensible to solve this via some simple heuristic.
* SelectCommand now correctly encodes the mailbox name again.
* Hierarchy separators from the LIST/LSUB commands are now properly parsed,
and taken into account.
* Folders in the file system are now created for mailboxes on the server,
supporting hierarchical mailbox names.
* A connection worker now has an IMAPFolder that handles the local side of the
mailbox, and an IMAPMailbox that handles the server side.
* Connection workers are now created/deleted, and setup correctly. They will
now also wait in case they don't have a mailbox until they get some.
* On SyncMessages(), the main connection worker is started if it is not already
running (it may only run already in idle mode).
* This will then list the subscribed folders, and create as many more connection
workers as allowed and make sense.
* Finally, it will distribute the folders to the workers which don't do anything
further yet.
* BMessageRunner does not take ownership of the message.
* Instead of waiting through the complete interval, we send an auto check
message immediately after launch (or whenever else the timer is being
started).
* Added constant instead of referring to 'moto' for the auto check message.
* The list was filled, but never emptied.
* If SyncMessages() was called more than once for the same POP3 instance,
this could garble the mails retrieved in the second run.
* Maintain the total size of mails in fSizes to be able to report progress
in more detail.
* Also adapted progress reporting to the argument changes made in MailProtocol
earlier.
* Minor cleanup.