Re: [sup-devel] Adding backward synchronization for Maildir sources

2011-03-13 Thread Damien Leone
Sup guys,

Sorry for having been so long.

What's new:

- I added an option in sup-sync-back-maildir to merge the :replied and
:forwarded labels/flags so the first time you run the script you
should not lose any information on the IMAP side;

- A way to detect if sup-sync-back-to-maildir should be executed in
order to synchronize your index back to the Maildir source in order to
prevent any loss of information. A magic file is written in the
configuration directory everytime the script is executed and it is
removed when the sync_back_to_maildir option is set from false to
true;

- I fixed a case when messages were not properly updated when they
were remotely modified.

I have pushed the last commits to the maildir-sync branch [0], it is
rebased from master. I also have a branch rebased from next on my own
repository if you'd rather a more up to date branch [1].

Please test and review! For more informations and a howto, read the
message quoted below this mail.

[0] http://gitorious.org/sup/mainline/commits/maildir-sync
[1] http://git.fensalir.fr/?p=dleone/sup.git

Excerpts from Damien Leone's message of ven. juil. 09 18:44:01 +0200 2010:
 Sup guys,
 
 I have been working on backward synchronization for Maildir sources
 last week and I need your help to test and review the code.
 
 I pushed my commits (based on the 'next' branch) to my repo which you
 can find here [0] for the web interface and here [1] for the git
 address.
 
 The following is related to Maildir sources ONLY.
 
 So what does work and what does not (if you don't want to read this,
 scroll to the quick howto below):
 
 - Sup will now stay synchronized with your remote sources by detecting
 if a message has been remotely updated (ie: you change a flag from
 another client), these updates will be applied to your local index and
 your thread-view-mode buffers should be properly refreshed;
 
 - When a message is remotely deleted, it should now disappear from
 your index;
 
 - There is a new configuration option called sync_back_to_maildir
 which is false by default. When true, this option updates your actual
 Maildir files when you change a label, this is done in real time
 before being saved to xapian. So for instance if you use offlineimap
 the changes should be synched back to your IMAP server by the next
 poll in Sup (assuming that your before-poll hook runs offlineimap);
 
 - I wrote a sup-sync-back-maildir script that will synchronize all
 messages from your sources at once. This should be executed the first
 time BEFORE any polling, otherwise your IMAP server will be synched to
 your Sup index and if you did not used another client to mark your
 emails as read etc. (like me) and to update your IMAP server then you
 will lose all what you did in Sup (labels, etc.);
 
 - I added two new hidden labels in Sup: 'replied' and 'forwarded',
 they are automatically added when replying, forwarding or bouncing a
 message, this is to bring a better Maildir support to Sup, this should
 be invisible for users;
 
 - However you will probably lose all your remote 'replied' and
 'forwarded' flags after your first backward synchronization to Maildir
 since Sup dropped these labels when it added your messages to xapian.
 
 - Moving a message from a Maildir source to another is not (yet?)
 supported.
 
 So, you should now be able to use multiple clients to handle your
 emails, for instance I can use gmail to mark messages as starred or
 so, it will be reflected in Sup. In the same way, if I mark a message
 as read in Sup it will appear as read in the gmail web interface.
 
 I tested this code with my main account (2 GB and like 15 Maildir
 sources) it works fine so far.
 
 Be warned that it is highly experimental, but if you use offlineimap
 it has a realdelete option so you *should* not lose any email, in the
 worst case it might mess your flags/labels up.
 
 I tested it only with offlineimap working with a gmail account.
 
 Quick howto:
 
 1. Close sup
 2. Backup your emails and your xapian index or use another Sup session
 3. Clone the branch [1]
 4. IMPORTANT: run bin/sup-sync-back-maildir to synchronize the
Maildirs you wish, check the help
 5. Add :sync_back_to_maildir: true to your config.yaml
 6. Run and use sup
 
 Please test it and make reviews! :)
 
 NOTE: if you want this to work, get sure that you are not calling
 offlineimap with the '-q' option (as suggested in the wiki) otherwise
 it will ignore the flag updates on IMAP server, so check your
 before-poll hook.
 
 [0] http://git.fensalir.fr/?p=dleone/sup.git
 [1] $ git clone git://fensalir.fr/dleone/sup.git -b maildir-sync
 

-- 
Damien Leone damien.le...@fensalir.fr

Web: http://dleone.fensalir.fr/
GPG: 0x82EB4DDF
___
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


Re: [sup-devel] Adding backward synchronization for Maildir sources

2010-07-25 Thread Edward Z. Yang
Excerpts from Rich Lane's message of Sat Jul 24 17:30:16 -0400 2010:
 I've rebased this against master and merged it to branch maildir-sync in
 the official repo. This is a big change, so help with testing and code
 review would be much appreciated.

Hi Rich,

I've moved my Sup checkout onto this branch. *test test test test*
After a week of usage, I'd say the changes are pretty stable.

Cheers,
Edward
___
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


Re: [sup-devel] Adding backward synchronization for Maildir sources

2010-07-21 Thread Damien Leone
Sup Edward,

Excerpts from Edward Z. Yang's message of Wed Jul 21 02:44:38 +0200 2010:
 Excerpts from Damien Leone's message of Tue Jul 20 05:39:41 -0400 2010:
 In retrospect, I'm fairly certain the majority of crashes were from user 
 hooks.

Could you paste me these hooks please?

 My Sup is running off of f150276f62e263d146fa81ede645b5e90e06a8a1.  They don't
 appear to have the deleted flag, but I didn't look too closely.  It's 
 *possible*
 that a regular synchronization would have picked them up, if they accidentally
 got dropped from my Sup index but were still inside my Maildir.  I suggest not
 worrying too much about this unless someone else reproduces.

What is your setup? IMAP + offlineimap? Do deleted mails work fine
now?

Cheers,

--
Damien Leone damien.le...@fensalir.fr

Web: http://dleone.fensalir.fr/
GPG: 0x82EB4DDF


signature.asc
Description: PGP signature
___
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


Re: [sup-devel] Adding backward synchronization for Maildir sources

2010-07-20 Thread Damien Leone
Hi,

Excerpts from Edward Z. Yang's message of Mon Jul 19 00:50:39 +0200 2010:
 I would recommend having some sort of flag like 'sync-back'd' programatically
 generated by sup-sync-back-maildir so that Sup will refuse to start if
 you turned on sync-backs without running this command.

Good idea, that might prevent some bad suprises.

 It seems to me that merging the Maildir flags and the Sup flags would
 let you preserve this, but for heavy Sup users this isn't a big deal.

True, and that could be done by sup-sync-back-maildir.

 I think this will be a pretty killer feature to have, because it means
 we can then assign primary tags and use those to have sync-backs move
 messages between Maildir folders (on the same account, I imagine), which
 would translate into a folder-sorted webmail view, which is about the
 best you can do without first-class label support in Maildir.  I know of
 at least one friend who this would be a deal-maker.

And that doesn't seem hard to implement, we should definitely consider
this feature, maybe after the primary code has been stabilized.

Cheers,

--
Damien Leone damien.le...@fensalir.fr

Web: http://dleone.fensalir.fr/
GPG: 0x82EB4DDF


signature.asc
Description: PGP signature
___
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel