Re: [sup-devel] [PATCHES] Add an account selector in edit-mode

2011-06-20 Thread Damien Leone
Hello,

Sorry I have been quite busy finishing my degree last weeks. I planned
to review and answer but it got delayed and delayed.

Thanks for pushing and fixing the issue with alternate addresses. I
will fetch it and let you know.

Excerpts from Hamish's message of dim. juin 19 23:48:40 +0200 2011:
> Excerpts from Hamish's message of Mon May 30 18:23:10 +0100 2011:
> > Excerpts from Damien Leone's message of Sun Mar 13 16:13:05 + 2011:
> > > 0002-edit-message-mode-Add-an-optional-account-selector.patch
> > 
> > I imagine though that you would want to handle all the possible email
> > addresses, so I've written an extra patch to do that, and pushed your
> > patch and mine onto the (new) account_selector branch on gitorious.
> > Please have a look and see if what I've done still works for you, and is
> > what you meant.
> > 
> > I also wondered whether to change the behaviour so that the account
> > selector will only appear if there is more than one possible email
> > address to choose from, but I thought it would be handy to be able to
> > reset the From: header to your usual From: using the selector, rather
> > than having to hand edit whatever was in the To: header that you are
> > replying to. What do you think?
> > 
> > I'll wait for you to review my changes before I merge this into next.
> > (My changes are in commit bf56b543cc664c40c3695e287ee8e7e924f2d0d1)
> 
> I've not heard anything for a bit, so I've pushed this into next for
> wider testing, with the guard so that the account selector will only
> appear if you have more than one email address. Shout out if it causes
> any problems.
> 
> Hamish

-- 
Damien Leone 

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


Re: [sup-devel] [PATCH] Avoid O(n^2) complexity for maildir deduplication.

2011-03-13 Thread Damien Leone
Pushed, thanks!

Excerpts from Edward Z. Yang's message of jeu. janv. 20 23:44:13 +0100 2011:
> Signed-off-by: Edward Z. Yang 
> ---
>  lib/sup/maildir.rb |8 +---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/sup/maildir.rb b/lib/sup/maildir.rb
> index ba8efed..bc30baa 100644
> --- a/lib/sup/maildir.rb
> +++ b/lib/sup/maildir.rb
> @@ -128,14 +128,16 @@ class Maildir < Source
>  ## deleted arrays, meaning that its flags changed or that it has
>  ## been moved, these ids need to be removed from added and deleted
>  add_to_delete = del_to_delete = []
> +map = Hash.new { |hash, key| hash[key] = [] }
> +deleted.each do |id_del|
> +map[maildir_data(id_del)[0]].push id_del
> +end
>  added.each do |id_add|
> -  deleted.each do |id_del|
> -if maildir_data(id_add)[0] == maildir_data(id_del)[0]
> +map[maildir_data(id_add)[0]].each do |id_del|
>updated.push [ id_del, id_add ]
>add_to_delete.push id_add
>del_to_delete.push id_del
>  end
> -  end
>  end
>  added -= add_to_delete
>  deleted -= del_to_delete

-- 
Damien Leone 

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


[sup-devel] [PATCHES] Add an account selector in edit-mode

2011-03-13 Thread Damien Leone
Sup guys,

Please see commit messages for detailed informations.

-- 
Damien Leone 

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


0001-reply-mode-improve-the-way-headers-are-handled.patch
Description: Binary data


0002-edit-message-mode-Add-an-optional-account-selector.patch
Description: Binary data


0003-edit-message-mode-Fix-the-way-signatures-are-handled.patch
Description: Binary data
___
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


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 

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] [PATCH] Mark the thread as read after the ThreadViewMode has been instancied and displayed

2011-03-07 Thread Damien Leone
Pushed.

-- 
Damien Leone 

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] [PATCH] line-cursor-mode: Add an option to disable automatic threads loading when scrolling down for slow CPUs

2011-03-07 Thread Damien Leone
Pushed.

-- 
Damien Leone 

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] call for new maintainers

2011-03-04 Thread Damien Leone
Hello,

Could I have an access so I can push the finished maildir-sync branch
as well as some other patches?

My gitorious login is dleone.

Thanks,

Excerpts from William Morgan's message of mer. janv. 26 16:18:59 +0100 2011:
> Reformatted excerpts from Michael Stapelberg's message of 2011-01-24:
> > I don’t have enough time to be the only person doing this, but I do
> > offer my help on reviewing/merging patches. Maybe having more than one
> > guy with commit access turns out to be a good thing?
> 
> Yeah, maybe that's the right idea.
> 
> So let's try this. Michael, Tero, Sascha, Edward, and everyone else
> who's had code make it into Sup successfully... if you send me your
> Gitorious usernames, I will add you to the Sup group and you will have
> push access. Then you can bypass the list mailing list for patches
> entirely, which will save me a lot of work.
> 
> All I ask is that you divide things into nice topic branches and merge
> them into next but not master. I'll merge individual branches into
> master when prepping for a release.

-- 
Damien Leone 

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


[sup-devel] [PATCH] line-cursor-mode: Add an option to disable automatic threads loading when scrolling down for slow CPUs

2011-02-27 Thread Damien Leone
Sup guys,

I run Sup on a Pogoplug-like device which has a slow CPU and I'm
always annoyed when I scroll down to reach an entry and then
everything stalls because some more threads are loading.

This patch adds an option to disable this behavior.

Cheers,

-- 
Damien Leone 

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


0001-line-cursor-mode-Add-an-option-to-disable-automatic-.patch
Description: Binary data


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


[sup-devel] [PATCH] Mark the thread as read after the ThreadViewMode has been instancied and displayed

2011-02-27 Thread Damien Leone
Sup guys,

The current behavior is that when opening an unread thread, the unread
label is removed at the instanciation of the ThreadViewMode, thus it
makes the 'N' indicator useless.

Even if new messages are automatically expanded it can be confusing
when you open some old message in the same thread, at the end you
might not remember which ones are new.

This patch delays the moment when the unread label is removed so when
opening a thread you know exactly what are the new messages thanks to
that 'N' indicator.

Cheers,

-- 
Damien Leone 

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


0001-Mark-the-thread-as-read-after-the-ThreadViewMode-has.patch
Description: Binary data


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


Re: [sup-devel] Strange maildir/OfflineImap/maildir-sync behavior

2011-01-19 Thread Damien Leone
Sup guys,

Excerpts from Roni Choudhury's message of mer. janv. 19 21:01:03 +0100 2011:
> I've noticed this from time to time as well (along with messages not
> disappearing, but instead part of the body appearing, then cut off
> with a strange error message about how sup can't load the message).  I
> find that killing the thread view buffer, then typing @ in index mode
> causes these to be fixed.  Just mentioning it because it's easier than
> restarting sup, and it may be related to the error you describe.  I'm
> also not sure how to file a bug report of that situation.

Yes I have noticed this one, it happens to me mainly when I send a
mail then perform a synchronization, probably because the sent mail
gets updated from the SentMail maildir (I use gmail), it's on the
to-fix list.

-- 
Damien Leone 

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] Strange maildir/OfflineImap/maildir-sync behavior

2011-01-19 Thread Damien Leone
Sup Edward,

Excerpts from Edward Z. Yang's message of mer. janv. 19 15:08:23 +0100 2011:
> One day, I opened up an old thread to reread an email, and much
> to my dismay, it was GONE!  Instead, there was one of those little
> red flags that Sup sticks on mail that is referenced by other
> threads, but which you don't have a copy of.
> 
> This was a bit bothersome, because no one likes it when their mail 
> mysteriously
> disappears. (It harkens back to a time when I accidentally deleted my entire
> inbox, tried to undo, but Sup crashed in the process and then offlineimap
> decided to sync the changes back to my main account, so I had to restore from
> backup and run with maxage... but that's a story for another time...)
> 
> Some sleuthing, however, revealed that the messages had not disappeared; they
> were still in my Maildir.  And sure enough, when I made Sup repoll the entire
> Maildir (by restarting it), the messages reappeared (along with another 50
> messages that I /swear/ I archived).
> 
> So my question is, why did Sup lose track of the messages?  Did it pick them
> up while they were in new and then OfflineIMAP moved them and they got lost?
> Can I make Sup tell me where it thinks a message should be living on my 
> filesystem
> so I can track these things?  Is this actually OfflineIMAP's fault?

I didn't notice this bug so I have no idea for the moment. :/

> P.S. Hey Damien, I know you're not planning on working on getting maildir-sync
> merged to master until later this January, but I was wondering if a version of
> the branch rebased on master would be of any use to you.

Sure! I was maintaining a maildir-sync-master branch on my repository
but it doesn't include the last bunch of commits.

-- 
Damien Leone 

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] state of maildir-sync branch?

2010-11-19 Thread Damien Leone
Hello,

I would say that the work is almost done, I still have things on my
todo list which are:

- Merge the replied/forwarded tag at the first synchronisation back to
  the IMAP so no information is lost

- There is still some work to do on the Polling#do_poll function
  because the way it is in the branch is too hackish

- Allow to move an email from a maildir to another

- Put a special flag or file for the first time you run sup with the
  branch so you get asked if you want to sync everything now

Beside that I have been running the branch for months without issue,
just a little bug that might be related to the point 2 of the list.

I often rebase the branch to master so it stays up to date, you can
find this on my repository [0] in the maildir-sync-master branch. The
damien branch is the same with extra patches I made months ago that
have not been reviewed.

Cheers,

[0] : http://git.fensalir.fr/?p=dleone/sup.git;a=summary

Excerpts from Ali Lown's message of lun. nov. 15 20:29:22 +0100 2010:
> What happened to this branch, because it hasn't been worked on since July, 
> but doesn't appear to have been merged into master/next.
> Does anyone know what else needs to be done to get it suitable for merging 
> (besides a git rebase)?

-- 
Damien Leone 

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] state of maildir-sync branch?

2010-11-18 Thread Damien Leone
Hi,

Excerpts from Alvaro Herrera's message of mar. nov. 16 16:35:32 +0100 2010:
> Somewhat related: I'd like to have a display of which source(s) a
> message belongs to, in the header widget.  I have no idea how to
> implement this though.  Any pointers?

If I remember correctly you can retrieve the source informations of a
mail by its "locations" attribute in the Message class.

A Location is a class which has a "source" attribute that can be
Maildir or Mbox and an "info" attribute that holds the filename on the
disk.

-- 
Damien Leone 

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-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 

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-21 Thread Damien Leone
Excerpts from Damien Leone's message of Wed Jul 21 10:52:00 +0200 2010:
> What is your setup? IMAP + offlineimap?

My bad, you mentioned offlineimap a few mails ago.

--
Damien Leone 

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 

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
Sup Edward,

Thank you for your feedback!

Excerpts from Edward Z. Yang's message of Mon Jul 19 00:46:33 +0200 2010:
> It makes Sup very crashy and there's some strange behavior.  This is probably
> the sixth time I'm composing this message (yeah, haven't learned my
> lesson.) In more detail...

I'm impressed, I never experienced such crashes, it is quite stable
here but I use only very basic hooks.

> * Backwards syncing appears to make old deleted mail show up again; I'm not
>   sure if it's because touching the Maildir causes Sup to pick up on deleted
>   tags again or something, but I had to go back and delete lots of deleted 
> mail.

Hmm, strange, do you use the latest commits of the branch? I pushed a
fix for deleted mails about 10 days ago.

The mails that show up again don't have the deleted flag at all?

> * When Sup is deleting messages, it is /extremely/ unsafe to iterate over
>   a list of all messages in the index and query them for info: the threading 
> means
>   that any given message might not exist anymore.  I had a hook that kept 
> triggering
>   this bug, and earlier on in the process drawing functions would also 
> frequently
>   Nil error.  This is probably under-tested codepaths in Sup that we should 
> track
>   down; unfortunately I didn't have the presence of mind to record traces 
> until
>   later (and the ones I got all look like my hooks fault).

I did not test the code with hooks, what do you suggest for this one?

> * In a similar vein, while messages are going away, '@' will occasionally 
> return
>   no messages (pressing again usually fixes it).  Messages that are labelled 
> inbox
>   will show up in 'U', but not in the inbox view without a Sup restart.

I never use this keybinding but indeed I noticed that pressing '@' two
times in a row was not showing anything.

I will try to track down these bugs.

Thanks again!
Cheers,

--
Damien Leone 

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-17 Thread Damien Leone
Hi Ben,

Excerpts from Ben Walton's message of Sat Jul 17 19:05:44 +0200 2010:
> I believe it is (not by me personally as I'm not affected).  How does
> it play with the recent maildir branch merge from Rich?

It should play well since I based my branch on the 'next' branch which
already had the 'maildir' merge.

--
Damien Leone 

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-17 Thread Damien Leone
So, any reviewer? I thought backward synchronization was a wanted
feature.

For information I have been testing it with my real account for more
than a week now without noticing any serious issue, I often check my
gmail web interface and everything is synched.

I had once a location trouble after having sent an email but I could
not reproduce and it has been resolved after a sup restart.

--
Damien Leone 

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-09 Thread Damien Leone
Hello Edward,

> 1. Suppose we decide to test your branch, and run into some show-stopper
>bugs.  What’s the procedure for backing out changes?

You should backup your Maildir directories and your xapian index, this
is what I did and if something goes wrong I can still restore my
backups and run offlineimap to resynch everything as it was before on
the IMAP server.

But for my initial tests I used a test Maildir containing nothing
important so maybe this is what you should do. ;)

> 2. What precisely are the semantics for handling Sup labels?

I followed the Maildir documentation [0]. When synching a message, Sup
builds the flags string and relink the file to the disk, moving it
from new/ to cur/ or vice versa if needed.

Related labels are: unread, replied, forwarded, deleted, draft (but it
won't work for now because draft messages in Sup are handled
separately), flagged (aka starred).

Every other labels are ignored because not supported.

[0] http://cr.yp.to/proto/maildir.html

--
Damien Leone 

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


[sup-devel] Adding backward synchronization for Maildir sources

2010-07-09 Thread Damien Leone
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 

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] [PATCHES] reply-mode, signatures and account selector

2010-07-03 Thread Damien Leone
Any reviewer for these patches?

Thanks.

Excerpts from Damien Leone's message of mer. juin 09 15:15:11 +0200 2010:
> I noticed an error in the third patch.
> Please consider the one attached to *this* email.
> 
> Regards,

--
Damien Leone 

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] [PATCHES] reply-mode, signatures and account selector

2010-06-09 Thread Damien Leone
I noticed an error in the third patch.
Please consider the one attached to *this* email.

Regards,

Excerpts from Damien Leone's message of mer. juin 09 14:53:16 +0200 2010:
> Sup guys,
> 
> Three patches are attached to this email, the commit messages should
> be self explanatory but here are some more details:
> 
> As the first patch changes the way headers are handled in reply-mode
> there is a regression in the before-edit hook possibilities.
> Before, we could write something like:
> 
> if header["Cc"] == "foo"
>header["Bcc"] = "bar"
> end
> 
> Hence, switching the reply-to type using the selector would have
> changed the Bcc field if a type using Cc was selected.
> 
> This would be no longer possible since there is now only one "set" of
> headers running the hook, however if you properly wrote your reply-to
> hook you can select the reply type you want and the previous code
> will be working as expected.
> 
> On the other hand (in my opinion), the reply-mode now handles better
> its job, that is to say changing To and Cc without interfering with
> other fields that might have been edited manually by the user.
> 
> I asked rlane about this on IRC:
> >  what is the reason for the before-edit hook being runned on 
> > @bodies and @header for each Reply-To types?
> >  that's so that when you switch reply-to type the right 
> > signature/etc is displayed
> 
> I see no regression regarding this in the patch, so it should be okay.
> 
> Other patches add an account selector in edit-mode (it is useful to me
> and I saw requests for such a feature) and a better signature handling
> regarding the edit_signature option.
> 
> Regards,

--
Damien Leone 

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


0003-edit-mode-change-the-way-signatures-are-handled.patch
Description: Binary data
___
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


[sup-devel] [PATCHES] reply-mode, signatures and account selector

2010-06-09 Thread Damien Leone
Sup guys,

Three patches are attached to this email, the commit messages should
be self explanatory but here are some more details:

As the first patch changes the way headers are handled in reply-mode
there is a regression in the before-edit hook possibilities.
Before, we could write something like:

if header["Cc"] == "foo"
   header["Bcc"] = "bar"
end

Hence, switching the reply-to type using the selector would have
changed the Bcc field if a type using Cc was selected.

This would be no longer possible since there is now only one "set" of
headers running the hook, however if you properly wrote your reply-to
hook you can select the reply type you want and the previous code
will be working as expected.

On the other hand (in my opinion), the reply-mode now handles better
its job, that is to say changing To and Cc without interfering with
other fields that might have been edited manually by the user.

I asked rlane about this on IRC:
>  what is the reason for the before-edit hook being runned on @bodies 
> and @header for each Reply-To types?
>  that's so that when you switch reply-to type the right signature/etc 
> is displayed

I see no regression regarding this in the patch, so it should be okay.

Other patches add an account selector in edit-mode (it is useful to me
and I saw requests for such a feature) and a better signature handling
regarding the edit_signature option.

Regards,


0001-reply-mode-improve-the-way-headers-are-handled.patch
Description: Binary data


0002-Add-account_selector-config-option.patch
Description: Binary data


0003-edit-mode-change-the-way-signatures-are-handled.patch
Description: Binary data
___
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel