Subject: [sup-talk] How to search for and mass tag thousands of emails?

From: [email-masked] (rodneyk)
Date: Thu, 6 Mar 2008 15:21:18 -0800 (PST)

Hi,
I just started using sup, after years of muttng I must say I like it a lot!
I have a giant inbox mbox with thousands of emails which I want to
starting using in sup. I can easily search and tag to categorize them all,
however, I can only tag the current screen full of search results. Is there
a way to tag all the search results, and not just the results on screen?

Being able to import existing mail and quickly organize is probably
something
most new users will need to do. I also checked out sup from the git repo,
and can run
devel/console, so if this mass tagging can only be done manually, I can do
it, as I'm
pretty proficient with ruby.

--Rodney
-- 
View this message in context: http://www.nabble.com/How-to-search-for-and-mass-tag-thousands-of-emails--tp15885391p15885391.html
Sent from the SUP Talk mailing list archive at Nabble.com.

---

From: [email-masked] (Manish Sapariya)
Date: Fri, 07 Mar 2008 12:45:09 +0530

I did it by writing before-add-message.rb hook and resyncing all
messages. The before-add-message hook allows you to add delete
labels before it indexes the message.

Hope this helps.
Regards,
Manish

--

---

From: [email-masked] (William Morgan)
Date: Fri, 07 Mar 2008 07:52:40 -0800

Reformatted excerpts from rodneyk's message of 2008-03-06:
> starting using in sup. I can easily search and tag to categorize them
> all, however, I can only tag the current screen full of search
> results. Is there a way to tag all the search results, and not just
> the results on screen?

You could do it through the GUI, but that probably won't scale well.
A better approach is to use the before-add-hook as Manish said, or to
use the development console to modify the index directly.

Feed devel/console.sh something like (untested):

  Index.index.search_each("potato") do |id, score|
    m = Index.build_message(id)
    puts "[#{id}] [#{m.from}] [#{m.subj}]"
    m.add_label :potato
    m.save! Index
  end

But there's not really much of a point to labeling the results of a
(simple) search. Labels are good for things that are hard to search for;
for everything else, just trust in the search!

> something most new users will need to do.

Sup supports auto-labeling folders out of the box, which I think is the
most common transition case.

> I also checked out sup from the git repo, and can run devel/console,
> so if this mass tagging can only be done manually, I can do it, as I'm

The big advantaage of the git repo (the next branch, at least) right now
is that adding labels to a message is much faster.

-- 
William <wmorgan-sup at masanjin.net>