Subject: Re: [sup-talk] Programmatically removing tags (:inbox)

From: Gaute Hope <[email-masked]>
Date: Fri, 02 May 2014 11:08:19 +0200

Excerpts from Gaute Hope's message of 2014-04-25 12:53:38 +0200:
> Excerpts from Alexander Klink's message of 2014-04-24 15:17:56 +0200:
> > Hi Matthieu,
> > 
> > Excerpts from Matthieu Rakotojaona's message of 2014-04-23 20:11:28 +0200:
> > > Excerpts from Alexander Klink's message of 2014-04-23 17:42:40 +0200:
> > > > I am trying to archive all my existing mails in order to make a nicer
> > > > workflow for myself (sort of a GTD thing with reading mails, either
> > > > acting directly or tagging them with 'todo' or 'hold' depending on whether I
> > > > have to do something or am waiting for someone to reply).
> > > 
> > > bin/sup-tweak-labels was made for this :)
> > 
> > Unfortunately, that fails completely for me:
> > 
> > $ sup-tweak-labels -r inbox -v --all-sources
> > [2014-04-24 15:15:50 +0200] WARNING: can't find character set by using locale, defaulting to utf-8
> > Found 149439 documents across 453 sources. Scanning...
> > [email-masked]: {inbox,unread,spam} => {unread,spam}
> > [2014-04-24 15:15:50 +0200] Flushing Xapian updates to disk. This may take a while...
> > /home/alech/.rvm/gems/ruby-1.9.3-p194/gems/sup-0.17.0/lib/sup/index.rb:141:in `update_message_state': undefined method `[]' for #<Redwood::Message:0x000000029ebf68> (NoMethodError)

This was fixed with the merge of #300. You should be able to use
sup-tweak-labels from git/develop now.

- gaute

---

From: Devon Gleeson <[email-masked]>
Date: Thu, 24 Apr 2014 18:00:16 +0000

I had this problem too when I first started using Sup. I think what I
ended up having to do was force sup to load all messages into memory
with !!, then tag all with T, then removed inbox. I took a long time for
sup to churn through all of that, but it did work eventually.

IDK, this does seem like a barrier to entry for new folks trying to
adopt sup.

-- 
Devon Gleeson
Software Engineer
TRIPWIRE | CONFIDENCE:SECURED
www.tripwire.com
_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk

---

From: Alexander Klink <[email-masked]>
Date: Thu, 24 Apr 2014 10:55:05 +0200

Hi MadHat2r,

Excerpts from MaDhAt2r's message of 2014-04-23 18:24:11 +0200:
> Try this: https://github.com/sup-heliotrope/sup/issues/272
> 
> Just use :inbox instead of :draft 

Unfortunately, that is very similar to the description below (basically
just a different way to find the message) and doesn't work for me either
:(

Cheers,
  Alex

---

From: Alexander Klink <[email-masked]>
Date: Thu, 24 Apr 2014 15:17:56 +0200

Hi Matthieu,

$ sup-tweak-labels -r inbox -v --all-sources
[2014-04-24 15:15:50 +0200] WARNING: can't find character set by using locale, defaulting to utf-8
Found 149439 documents across 453 sources. Scanning...
[email-masked]: {inbox,unread,spam} => {unread,spam}
[2014-04-24 15:15:50 +0200] Flushing Xapian updates to disk. This may take a while...
/home/alech/.rvm/gems/ruby-1.9.3-p194/gems/sup-0.17.0/lib/sup/index.rb:141:in `update_message_state': undefined method `[]' for #<Redwood::Message:0x000000029ebf68> (NoMethodError)
	from /home/alech/.rvm/gems/ruby-1.9.3-p194/gems/sup-0.17.0/bin/sup-tweak-labels:109:in `block in <top (required)>'
	from /home/alech/.rvm/gems/ruby-1.9.3-p194/gems/sup-0.17.0/lib/sup/index.rb:288:in `block in each_id'
	from /home/alech/.rvm/gems/ruby-1.9.3-p194/gems/sup-0.17.0/lib/sup/index.rb:288:in `each'
	from /home/alech/.rvm/gems/ruby-1.9.3-p194/gems/sup-0.17.0/lib/sup/index.rb:288:in `each_id'
	from /home/alech/.rvm/gems/ruby-1.9.3-p194/gems/sup-0.17.0/bin/sup-tweak-labels:95:in `each'
	from /home/alech/.rvm/gems/ruby-1.9.3-p194/gems/sup-0.17.0/bin/sup-tweak-labels:95:in `<top (required)>'
	from /home/alech/.rvm/gems/ruby-1.9.3-p194/bin/sup-tweak-labels:19:in `load'
	from /home/alech/.rvm/gems/ruby-1.9.3-p194/bin/sup-tweak-labels:19:in `<main>'
	from /home/alech/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `eval'
	from /home/alech/.rvm/gems/ruby-1.9.3-p194/bin/ruby_noexec_wrapper:14:in `<main>'

Any ideas?

Cheers,
  Alex

---

From: Matthieu Rakotojaona <[email-masked]>
Date: Wed, 23 Apr 2014 20:11:28 +0200

Excerpts from Alexander Klink's message of 2014-04-23 17:42:40 +0200:
> Hi all,

-- 
Matthieu Rakotojaona

---

From: Alexander Klink <[email-masked]>
Date: Wed, 23 Apr 2014 17:42:40 +0200

Hi all,

For this, I want to remove the :inbox tag from all mails in my index.
As a start I looked at https://github.com/sup-heliotrope/sup/issues/225
and tried to reproduce what gauteh did in the console (with one single mail
which I gave a testfoo tag in sup):

| q = Index.parse_query('label:testfoo')
| a = []
| Index.each_message(q) { |x| a.push x }
| puts a # this should only contain one message if you only have one marked as draft
| m = a[0] # get the first message or find the problematic one
| m.labels.delete :testfoo
| m.sync_back
| exit

Unluckily, both in sup and programmatically the mail still has the
testfoo tag. I also tried adding an Index.save_index before the exit,
but that didn't help either.

Any ideas on how to achieve that goal (I am on 0.17.0 if that helps)?

Cheers,
  Alex

---

From: Gaute Hope <[email-masked]>
Date: Fri, 25 Apr 2014 12:53:38 +0200

> /home/alech/.rvm/gems/ruby-1.9.3-p194/gems/sup-0.17.0/lib/sup/index.rb:141:in `update_message_state': undefined method `[]' for #<Redwood::Message:0x000000029ebf68> (NoMethodError)

Could you check if #295 [0] solves this for you? --tweak-labels wasn't
updated for the latest Index api changes. You have to specify the
--sync-back option if you want message flags to be synced back to
maildir, this _ignores_ any source specific sync_back settings so use
sup-tweak-labels on only one source at the time if you need more fine
grained control.

Note that even though you do the changes in the console as suggested in
the earlier mails the index list in the open sup won't be updated before
you restart sup.

- gaute

[0] https://github.com/sup-heliotrope/sup/pull/295

---

From: MaDhAt2r <[email-masked]>
Date: Wed, 23 Apr 2014 11:24:11 -0500

Hey Alex,