From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.42.224.197 with SMTP id ip5cs13853icb; Wed, 16 Feb 2011 07:00:05 -0800 (PST) Received: by 10.42.221.193 with SMTP id id1mr900901icb.524.1297868404822; Wed, 16 Feb 2011 07:00:04 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id x24si376345vcr.0.2011.02.16.07.00.04; Wed, 16 Feb 2011 07:00:04 -0800 (PST) Received-SPF: pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-talk-bounces@rubyforge.org Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 25BE63C8043; Wed, 16 Feb 2011 10:00:04 -0500 (EST) Received: from plecavalier.com (thelittlecloset.ca [64.40.149.83]) by rubyforge.org (Postfix) with ESMTP id C3CE51858356 for ; Wed, 16 Feb 2011 09:35:03 -0500 (EST) Received: (qmail 28139 invoked from network); 16 Feb 2011 08:35:02 -0600 Received: from xplr-142-46-160-183.xplornet.com (HELO localhost) (142.46.160.183) by thelittlecloset.ca with (DHE-RSA-AES128-SHA encrypted) SMTP; 16 Feb 2011 08:35:02 -0600 From: Philippe LeCavalier To: Tero Tilus In-reply-to: <1297848161-sup-8178@tilus.net> References: <1297780499-sup-4885@plc.intranet.plecavalier.com> <1297848161-sup-8178@tilus.net> Date: Wed, 16 Feb 2011 09:35:00 -0500 Message-Id: <1297865749-sup-514@plc.intranet.plecavalier.com> User-Agent: Sup/0.12.1 Cc: Sup users Subject: Re: [sup-talk] More before-add hook issues X-BeenThere: sup-talk@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: User & developer discussion of Sup List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-talk-bounces@rubyforge.org Errors-To: sup-talk-bounces@rubyforge.org 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 : 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