Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] 0/0...I made it
@ 2011-02-13 20:57 Philippe LeCavalier
  2011-02-14 18:11 ` David J. Hamilton
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe LeCavalier @ 2011-02-13 20:57 UTC (permalink / raw)
  To: sup-talk

Well, despite not finding a truly efficient method for autolabeling my mail -I'm not worried I won't, I just haven't found it yet- after 30 some days of due deligence my inbox is for now back to 0.

I think this speaks volumes about just how good Sup is considering I did this mostly by selecting a thread, highlight a contact(this really should be mentioned in a wiki somewhere), S, T, =, L, <various labels seperated by whitespaces starting with '-inbox'>

This wasn't as painful as it may sound. In fact it was almost enjoyable. To put things into perspective; I started the day out with approx. ten thousand msgs left in my inbox and it's ten to four. Considering I prob. spent every other hour entertaining the kids I prob. spent a three to four hours.

I almost crossed over to notmuch just yesterday but I stuck with Sup and I'm glad I did.

Cheers!
-- 
Thanks,
Phil
_______________________________________________
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] 0/0...I made it
  2011-02-13 20:57 [sup-talk] 0/0...I made it Philippe LeCavalier
@ 2011-02-14 18:11 ` David J. Hamilton
  2011-02-14 19:18   ` Philippe LeCavalier
  0 siblings, 1 reply; 3+ messages in thread
From: David J. Hamilton @ 2011-02-14 18:11 UTC (permalink / raw)
  To: sup-talk

Philippe,

Excerpts from Philippe LeCavalier's message of Sun Feb 13 12:57:30 -0800 2011:
> Well, despite not finding a truly efficient method for autolabeling my mail
> -I'm not worried I won't, I just haven't found it yet- after 30 some days of
> due deligence my inbox is for now back to 0.

Have you tried writing a before-add-message hook?  If so, what problems have you
run in to with your attempts at autolabeling?

Here's a snippet of mine:

  # before-add-message.rb

  def autolabel message, label 
    log "Adding label [#{label}] to #{message.id}"
    message.add_label label
  end

  def autolabel_email message, regexes, label
    regexes = [ regexes ] unless regexes.is_a? Enumerable
    if message.recipients.any? do |recipient|
          AccountManager.is_account_email? recipient.email and
            regexes.any?{ |r| recipient.email =~ r }
        end
      autolabel message, label
    end

    if    AccountManager.is_account_email? message.from.email and
          regexes.any?{ |r| message.from.email =~ r }
        
      autolabel message, label
    end
  end


  unless message.nil?
    autolabel_email   message,    /ucdavis.edu$/i,     'ucdavis'
    # … lines similar to above, giving regexes or arrays of regexes and the
    # desired label.
  end

-- 
med vänlig hälsning
David J. Hamilton
_______________________________________________
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] 0/0...I made it
  2011-02-14 18:11 ` David J. Hamilton
@ 2011-02-14 19:18   ` Philippe LeCavalier
  0 siblings, 0 replies; 3+ messages in thread
From: Philippe LeCavalier @ 2011-02-14 19:18 UTC (permalink / raw)
  To: David J. Hamilton; +Cc: sup-talk

Hi David.
Excerpts from David J. Hamilton's message of Mon Feb 14 13:11:40 -0500 2011:
> Philippe,
> 
> Excerpts from Philippe LeCavalier's message of Sun Feb 13 12:57:30 -0800 2011:
> > Well, despite not finding a truly efficient method for autolabeling my mail
> > -I'm not worried I won't, I just haven't found it yet- after 30 some days of
> > due deligence my inbox is for now back to 0.
> 
> Have you tried writing a before-add-message hook?  If so, what problems have you
> run in to with your attempts at autolabeling?

Yeah. I've tried a bunch of options[1] -and still am-. Mostly, I don't understand what's going on during the functions and it's making things challenging to say the least.

I really like the idea of matching email addresses using an external file as in the sup-wiki. As I mention in [1] simple operations ie adding/removing a single label works like a charm. But I want a model that will allow me to search in a very granular way. I want to break down my labels.

|client
||companyA
||companyB
||companyC
|||position
|||invoice
|||issues
|||reports

|ff #friends and foe
||wife,friends, family
|||contact
||||persons name I don't like

This way I can search for all 'company' then refine by 'position' 'invoice'...etc. Or go straight to a specific group or people 'position' ie all 'exec' or 'finance'. But in order to do that I need a before-add-message hook that will add multiple labels either in one invocation or multiple ones.

It goes without saying, but I'll state it anyways, my desired model far exceeds my ability as non-programmer. However, I'm a logical and patience individual and I know that if I can find a working example I can 'take it from there'.

At the moment, it seems my biggest problem is labeling an email more than once. I found a few posts/relevant discussions[2,3] regard sup and multiple labels but nothing has lead me down the correct path.

ref:
[1] http://rubyforge.org/pipermail/sup-talk/2011-February/004504.html
[2] https://github.com/jacius/sup-filters/blob/master/filters.example.yaml
[3] http://www.mail-archive.com/sup-talk@rubyforge.org/msg03361.html
> Here's a snippet of mine:
> 
>   # before-add-message.rb
> 
>   def autolabel message, label 
>     log "Adding label [#{label}] to #{message.id}"
>     message.add_label label
>   end
> 
>   def autolabel_email message, regexes, label
>     regexes = [ regexes ] unless regexes.is_a? Enumerable
>     if message.recipients.any? do |recipient|
>           AccountManager.is_account_email? recipient.email and
>             regexes.any?{ |r| recipient.email =~ r }
>         end
>       autolabel message, label
>     end
> 
>     if    AccountManager.is_account_email? message.from.email and
>           regexes.any?{ |r| message.from.email =~ r }
>         
>       autolabel message, label
>     end
>   end
> 
> 
>   unless message.nil?
>     autolabel_email   message,    /ucdavis.edu$/i,     'ucdavis'
>     # … lines similar to above, giving regexes or arrays of regexes and the
>     # desired label.
>   end
> 
-- 
Thanks,
Phil
_______________________________________________
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:[~2011-02-14 19:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-13 20:57 [sup-talk] 0/0...I made it Philippe LeCavalier
2011-02-14 18:11 ` David J. Hamilton
2011-02-14 19:18   ` Philippe LeCavalier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox