From: Philippe LeCavalier <support@plecavalier.com>
To: David J. Hamilton <groups@hjdivad.com>
Cc: sup-talk <sup-talk@rubyforge.org>
Subject: Re: [sup-talk] 0/0...I made it
Date: Mon, 14 Feb 2011 14:18:38 -0500 [thread overview]
Message-ID: <1297707717-sup-3255@plc.intranet.plecavalier.com> (raw)
In-Reply-To: <1297706861-sup-7672@nyx.local>
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
prev parent reply other threads:[~2011-02-14 19:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-13 20:57 Philippe LeCavalier
2011-02-14 18:11 ` David J. Hamilton
2011-02-14 19:18 ` Philippe LeCavalier [this message]
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=1297707717-sup-3255@plc.intranet.plecavalier.com \
--to=support@plecavalier.com \
--cc=groups@hjdivad.com \
--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