* [sup-talk] Moving messages between sources and generic auto labeling hook
@ 2010-01-04 1:41 Scott Henson
0 siblings, 0 replies; 3+ messages in thread
From: Scott Henson @ 2010-01-04 1:41 UTC (permalink / raw)
To: sup-talk
[-- Attachment #1.1: Type: text/plain, Size: 1278 bytes --]
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.
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?
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.
Any help would be much appreciated. Thanks.
--
Scott Henson
[-- Attachment #1.2: Type: text/html, Size: 1539 bytes --]
[-- Attachment #2: Type: text/plain, Size: 140 bytes --]
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 3+ messages in thread
* [sup-talk] Moving messages between sources and generic auto labeling hook
@ 2010-01-03 18:54 Scott Henson
2010-01-05 21:09 ` William Morgan
0 siblings, 1 reply; 3+ messages in thread
From: Scott Henson @ 2010-01-03 18:54 UTC (permalink / raw)
To: sup-talk
[-- Attachment #1.1: Type: text/plain, Size: 1278 bytes --]
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.
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?
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.
Any help would be much appreciated. Thanks.
--
Scott Henson
[-- Attachment #1.2: Type: text/html, Size: 1400 bytes --]
[-- Attachment #2: Type: text/plain, Size: 140 bytes --]
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [sup-talk] Moving messages between sources and generic auto labeling hook
2010-01-03 18:54 Scott Henson
@ 2010-01-05 21:09 ` William Morgan
0 siblings, 0 replies; 3+ messages in thread
From: William Morgan @ 2010-01-05 21:09 UTC (permalink / raw)
To: sup-talk
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-01-05 21:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-04 1:41 [sup-talk] Moving messages between sources and generic auto labeling hook Scott Henson
-- strict thread matches above, loose matches on Subject: below --
2010-01-03 18:54 Scott Henson
2010-01-05 21:09 ` William Morgan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox