From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.42.240.136 with SMTP id la8cs149345icb; Thu, 10 Feb 2011 09:02:28 -0800 (PST) Received: by 10.229.241.196 with SMTP id lf4mr16102982qcb.284.1297357346054; Thu, 10 Feb 2011 09:02:26 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id g29si422153qck.139.2011.02.10.09.02.25; Thu, 10 Feb 2011 09:02:26 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 81A8D19782F8; Thu, 10 Feb 2011 12:02:25 -0500 (EST) Received: from mail-pv0-f178.google.com (mail-pv0-f178.google.com [74.125.83.178]) by rubyforge.org (Postfix) with ESMTP id 928A2185837B for ; Thu, 10 Feb 2011 11:40:44 -0500 (EST) Received: by pvg6 with SMTP id 6so676811pvg.23 for ; Thu, 10 Feb 2011 08:40:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:content-type:cc:subject:from:to :in-reply-to:references:date:message-id:user-agent :content-transfer-encoding; bh=vidiVyHjE+mNpoS5icyxesUUUl3YY9tujlN3WsuetNo=; b=nG04kcNvS+l8lpdCnQXztTiznosU2/YhivwwMDqAS9v5EGJkA/BCwXNFWsD6KxWeHb vyfa0eMzLgV/pCi5Yo7sE8hzq7s6bpD7LFkN6BjNIx/rouNJqjt2KEpY6FWWv4fb5gS6 PSDGtNHE97DFvuP6W9ctMGFkvNMyWj3W+NQWA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:content-type:cc:subject:from:to:in-reply-to:references:date :message-id:user-agent:content-transfer-encoding; b=Qr72Sl9pCsWdI7NtTylPpSF9OzkuFcmERtFPKWU6dOGZJhE59hFjRETaQQhLvJEztM hUKxC7ZyKR1pv4ZQbfe3H4iimDPYI4afF6cnG5XANwlTUv0kX20zQ3HCO5EtW8oWHe49 Ej8hTuN93+heFlVgAbW6WrBmvIMGZxmdmi9z8= Received: by 10.142.158.5 with SMTP id g5mr20034109wfe.325.1297356043618; Thu, 10 Feb 2011 08:40:43 -0800 (PST) Received: from localhost (c-24-128-128-5.hsd1.vt.comcast.net [24.128.128.5]) by mx.google.com with ESMTPS id w14sm226540wfd.18.2011.02.10.08.40.41 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 10 Feb 2011 08:40:42 -0800 (PST) From: Mark Alexander To: Philippe LeCavalier In-reply-to: <1297346751-sup-70@plc.intranet.plecavalier.com> References: <1297346751-sup-70@plc.intranet.plecavalier.com> Date: Thu, 10 Feb 2011 11:40:38 -0500 Message-Id: <1297355619-sup-8657@bloovis.org> User-Agent: Sup/0.12.1 Cc: sup-talk Subject: Re: [sup-talk] best method for before-add-message.rb 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 Excerpts from Philippe LeCavalier's message of Thu Feb 10 09:44:18 -0500 2011: > i)external file reference (would be my preferred method) > -can't list anything other than full email addresses in the file > @domain.com, wildcards...etc. would be nice I'm not sure if this will help (it's pretty primitive), but here's my before-add-message.rb, showing how to do regular expression matches on addresses: # Label by subject. This is useful for messages # generated automatically by Bugzilla or cron jobs. case message.subj when /\[P4 SUBMIT/ message.add_label :p4 when /\[Bug.*project:/ message.add_label :projbugs when /\[Bug/ message.add_label :bugs when /project.*suite results/ message.add_label :testing end # Label by recipients. This is useful for mailing lists. to_string = message.recipients.map { |t| t.email }.join(" ") case to_string # Personal labels when /\bsup-(devel|talk)@rubyforge.org\b/ message.add_label :sup # Work labels when /pi@widgets/ message.add_label :pi when /git-users@widgets/ message.add_label :git when /team-project@widgets/ message.add_label :project end # Label by from. This is useful for personal emails. case message.from.email when /@amazon/ message.add_label :amazon when /@facebook/ message.add_label :facebook when /@netflix/ message.add_label :netflix when /somebody@gmail.com|somebody@aol.com/ message.add_label :somebody end _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk