From: William Morgan <wmorgan-sup@masanjin.net>
To: sup-talk <sup-talk@rubyforge.org>
Subject: Re: [sup-talk] Moving messages between sources and generic auto labeling hook
Date: Tue, 05 Jan 2010 13:09:57 -0800 [thread overview]
Message-ID: <1262725492-sup-5621@masanjin.net> (raw)
In-Reply-To: <6c0c31751001031054o1befd9e4k34911bcc9e04461c@mail.gmail.com>
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 /\bgit@vger.kernel.org\b/
message.add_label :git
message.remove_label :inbox
when /\bsup-(devel|talk)@rubyforge.org\b/
message.add_label :sup
when /\bditz-talk@rubyforge.org\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 <wmorgan-sup@masanjin.net>
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
next prev parent reply other threads:[~2010-01-05 21:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-03 18:54 Scott Henson
2010-01-05 21:09 ` William Morgan [this message]
2010-01-04 1:41 Scott Henson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1262725492-sup-5621@masanjin.net \
--to=wmorgan-sup@masanjin.net \
--cc=sup-talk@rubyforge.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox