Subject: Re: [sup-devel] Writing changes back to sources

From: Ben Walton <[email-masked]>
Date: Fri, 12 Mar 2010 10:22:22 -0500

Excerpts from Scott Henson's message of Mon Mar 08 00:45:54 -0500 2010:

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

This is overall a good idea, I think.  I haven't looked at this in
some time, so my memory may be off or the code changed in the interim,
but if you did something like this, you could like do away with
SentManager completely.  Without the addition support of the mbox
store_message method, it would be a skeleton for default_set_source
(or whatever that method is)...at which point that functionality could
be handled differently.

Just a few (hopefully valid and useful) thoughts.

Thanks
-Ben
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Scott Henson <[email-masked]>
Date: Mon, 8 Mar 2010 00:45:54 -0500

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