[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sup-devel] Writing changes back to sources



I've been working on getting writing changes back to maildirs.  I've got a stab that basically re-implements sup-sync-back in its own script, but I'm not really satisfied with it.  What I would like to be is create a script that will modify a source with an arbitrary sup _expression_.  I guess some examples would be a good way to show what I am talking about.

$ sup-write --drop "is:deleted" maildir:/home/user/Mail/INBOX

This would drop all mail matching the _expression_ "is:deleted" from the INBOX source.

$ sup-write --archive maildir:/home/user/Mail/Archives "!label:inbox" maildir:/home/user/Mail/INBOX

This would move all messages from the INBOX to Archives that have been archived.

$ sup-write --store "has:mailist" maildir:/home/user/Mail/Lists

This would find all messages in the Index and write them to the source.

You could put any valid sup _expression_ in the above and have it push the results out to the requested sources.  You could specify multiple sources to have it applied across all of them.  My thought is that you would write a series of scripts to push changes to the index down to the sources.  For instance, remove all deleted mail and spam, then store labels to their own sources (good for gmail integration) and finally archive what is left.

To do the above I think we probably need standardize how messages are added and removed from sources.  The maildir source has store_message and delete.  I would suppose that we would need to implement something similar for the other sources (is mbox the only other one left?).  Does this seem to be a good idea or do we want to continue having different ways of writing back to sources?

--
Scott Henson
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel