Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: Philippe LeCavalier <support@plecavalier.com>
To: Tero Tilus <tero@tilus.net>
Cc: Sup users <sup-talk@rubyforge.org>
Subject: Re: [sup-talk] More before-add hook issues
Date: Wed, 16 Feb 2011 09:35:00 -0500	[thread overview]
Message-ID: <1297865749-sup-514@plc.intranet.plecavalier.com> (raw)
In-Reply-To: <1297848161-sup-8178@tilus.net>

Hi Tero.
Excerpts from Tero Tilus's message of Wed Feb 16 04:31:17 -0500 2011:
> Philippe LeCavalier, 2011-02-15 16:55:
> > 8 if ! addressfile.grep(/#{message.list_address.email}/).empty?
> 
> Try
> 
> if message.list_address && !addressfile.grep(/#{message.list_address.email}/).empty?
> 
It worked! Thanks Tero. Just for everyone's benefit this is what the complete rule looks like:

  7   if message.list_address &&
  8   addressfile = File.open("/home/plecavalier/.sup/hooks/label.list","r")
  9   !addressfile.grep(/#{message.list_address.email}/).empty?
 10  message.add_label :list
 11 end

Tero, I'm assuming this is what you expected me to do!? Would I be able to add more functions:

i) read a list of addresses in a second file ie label.list.sup against list-post header from each list and label accordingly ie if it's sup-talk@rubyforge assign label: sup if it's cups->cups...and so on?
ii) lastly, remove :inbox

I'm asking in that fashion because in my experience thus far if I go and build rules for each list to:
a) label :list
b) label :<list_name>
c) -label :inbox
d) wash, rinse and repeat for each list

the hook dies. So it's apparent to me that all functions need to occur in the same invocation. ie multiple, separate functions on the same msg fails. I found a post somewhere(which I can't seem to find anymore) where someone stated multiple invocations on the same msg isn't possible but there must be a workaround...Someone must be applying more than one label to a msg at the same time. Isn't there someone out there succeeding at this?


-- 
Thanks,
Phil
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


      reply	other threads:[~2011-02-16 15:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-15 14:55 Philippe LeCavalier
2011-02-16  9:31 ` Tero Tilus
2011-02-16 14:35   ` 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=1297865749-sup-514@plc.intranet.plecavalier.com \
    --to=support@plecavalier.com \
    --cc=sup-talk@rubyforge.org \
    --cc=tero@tilus.net \
    /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