Subject: Re: [sup-talk] Moving messages between sources and generic auto labeling hook

From: William Morgan <[email-masked]>
Date: Tue, 05 Jan 2010 13:09:57 -0800

Reformatted excerpts from Scott Henson's message of 2010-01-03:
> Is it possible to have sup move messages between sources?

No. Mutt is quite good at this, actually. If you do move them, you will
have to update the Sup index to reflect the new source.

> I've found a python script that will do this for me on the Maildir, but I'm
> not sure what this will do to the sup index.  Would I be able to do this on
> a nightly basis and then do a full rescan on the INBOX source and the
> archive sources?  Would the messages keep their labels?

The easiest thing would be to make a dump of the message state with
sup-dump, and then sup-sync -c --restore <dumpfile> on both sources.
Of course, check first to make sure this works!

That incurs a silly amout of redundant work, so you could also consider
the fancier way of just updating the source_id in the index, using the
console.

> My second question revolves around labeling.  I see the before add hook is
> what is supposed to be used for labeling.  Does everyone just write ruby in
> that hook or does someone have a simpler syntax for filtering that a generic
> before add hook that uses it?  I'm thinking the simplest would be yaml, but
> this being ruby I would think creating a DSL for filtering would be pretty
> easy and make autolabeling an easier affair than writing straight ruby.

The hooks are just ruby at the moment. I'm not convinced a DSL would be
an improvement. For example, my before-add hook looks like this:

  to_string = message.recipients.map { |t| t.email }.join(" ")
  case to_string
  when /\[email-masked]\b/
    message.add_label :git
    message.remove_label :inbox
  when /\bsup-(devel|talk)@rubyforge.org\b/
    message.add_label :sup
  when /\[email-masked]\b/
    message.add_label :ditz
  [...]

Apart from the first line, it seems pretty DSL-like already to me.  But
try it, if you like, and report back if you come up with something nice.
-- 
William <[email-masked]>
_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk

---

From: Scott Henson <[email-masked]>
Date: Sun, 3 Jan 2010 13:54:23 -0500

Is it possible to have sup move messages between sources?  I have only so
much storage on my mail server (work related) and if I don't expire messages
out of my inbox, I hit the limit on a regular basis.  I have offlineimap
syncing the email down to local maildirs.  I would like to have sup move
mails from the INBOX source to an archive source.  Is this possible?  It
would be nice if the archive source was a group of sources according to year
and month, but that would be gravy.

Any help would be much appreciated.  Thanks.

-- 
Scott Henson