<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span><br></span></div><div>Sebastian Spaeth wrote:</div><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; ">On Wed, 17 Aug 2011 11:00:48 -0700 (PDT), chris coleman wrote:<br>> On syncs today, OfflineIMAP does things like this: <br>> When I move a message, on the local server, from the Inbox to the Trash, offlineimap deletes the Inbox message copy on the remote server, and uploads the message from local server Trash to remote server Trash ! <br><br>Yep, that is the expected operation.<br> <br>> For a 1MB message, that's 10 seconds to upload to the remote server's Trash! <br>> <br>> OfflineIMAP would run 20X faster/more efficiently if it would *move* the message from the
remote server Inbox, to the remote server Trash - a move operation should execute in about 0.5 second.<br><br>It would but a) it operates on a folder-by-folder basis (no excuse<br>though) and b) it is not trivial to detect such moves between<br>folders. It is not uncommon to have multiple emails with the same<br>Message-ID in different folders, and they do not necessarily have the<br>same content. Think e.g. a mail that you sent and that you get back via<br>a mailing list subscription. It will have the same Message-ID, it will<br>be in your "Sent" folder and it will be in your "INBOX" folder. Some<br>broken MUAs are also said to produce identical Message-IDs from time to<br>time.<br><br>Detecting that you actually moved a mail from one folder to another is<br>therefore no trivial business. The safe bet is to treat these as a<br>removal and addition in the folders.<br><br>Sebastian<br>------------------<br><br></div><div style="font-family: times new
roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_16_131367348474759">Hi Sebastian,</div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_16_131367348474759"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_16_131367348474759">With UID/UIDPLUS isn't it now possible to save the list of UID's for each folder, in the sqlite database, at the end of the current run of OfflineIMAP ?</div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_16_131367348474759"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_16_131367348474759">At the start of the next run, compare the UIDs in each folder to the previously seen list of UIDs for each folder ?</div><div style="font-family: times new roman, new york, times, serif; font-size:
12pt;" class="yui_3_2_0_16_131367348474759"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_16_131367348474759">This method lets us track movements of messages between the folders, ie when a message is not "new in a folder but we don't know where it came from" just "this message was simply moved from Inbox to Trash"</div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_16_131367348474759"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_16_131367348474759">So, with the saved information about where the message came from, we are able to greatly improve the efficiency of the algorithm: just do a 0.5 second MOVE on the remote IMAP server instead of consuming 10 seconds of saturated uplink bandwidth. Less network traffic, less potential for data corruption, faster runtime, less
memory and CPU usage, less vulnerable to crashes...</div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_16_131367348474759"><br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_16_131367348474759">Chris<br></div><div style="font-family: times new roman, new york, times, serif; font-size: 12pt;" class="yui_3_2_0_16_131367348474759"><br></div></div></div></body></html>