From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.42.240.136 with SMTP id la8cs239940icb; Sun, 13 Feb 2011 09:34:30 -0800 (PST) Received: by 10.229.79.12 with SMTP id n12mr2152845qck.129.1297618470261; Sun, 13 Feb 2011 09:34:30 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id q5si3127367qcs.187.2011.02.13.09.34.30; Sun, 13 Feb 2011 09:34:30 -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 C4116167832F; Sun, 13 Feb 2011 12:34:29 -0500 (EST) Received: from mail-qw0-f50.google.com (mail-qw0-f50.google.com [209.85.216.50]) by rubyforge.org (Postfix) with ESMTP id EA95018581B2 for ; Sun, 13 Feb 2011 12:12:15 -0500 (EST) Received: by qwd6 with SMTP id 6so2735420qwd.23 for ; Sun, 13 Feb 2011 09:12:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=VPPp9/KafIalZhgaTpb6F9475dC8fr8toNzqnEsUf5I=; b=REKF/CJ1KTDA75u0UQeVChCHSVSCx/FvUvmMeN6k/A8aMn5j4tGCPFMDVFnXqe3YBX 3ylzT78bZttGLvAWSIq8YQzzVrtc1BdsN0A4QwRqyxJIBbXYR7+oTlTPj/WdfP9BSO1N 5j9WT4wH+uFz2xZ9aNKj5SARMFixEFrtHWRew= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=hiVMtXViRKksgSnzaTz+j9G7p2pTCCZmKwJHVKEmT8QxTtM/wLpjKCSFSILQx9gQwf 6AqKCCAIBP6tqFb1CyoNbwe9qQ0oTLpZE3p/KyVuw9+4xnMNi/QO47z7wKb8cp7C4cNy BEeOkYB7ROYbr7OYelf5Hkfx28sZreOV3B9i0= MIME-Version: 1.0 Received: by 10.224.11.149 with SMTP id t21mr2232772qat.369.1297617135439; Sun, 13 Feb 2011 09:12:15 -0800 (PST) Received: by 10.229.218.79 with HTTP; Sun, 13 Feb 2011 09:12:15 -0800 (PST) In-Reply-To: <1297560324-sup-4333@niflheimr> References: <1297346751-sup-70@plc.intranet.plecavalier.com> <1297355619-sup-8657@bloovis.org> <1297356327-sup-9107@plc.intranet.plecavalier.com> <1297357197-sup-5893@bloovis.org> <1297364797-sup-8388@plc.intranet.plecavalier.com> <1297375381-sup-2823@plc.intranet.plecavalier.com> <1297560324-sup-4333@niflheimr> Date: Sun, 13 Feb 2011 17:12:15 +0000 Message-ID: From: Hamish D To: 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-talk-bounces@rubyforge.org Errors-To: sup-talk-bounces@rubyforge.org > what would be the best way to match - for instance - the List-Id-Header in case > it's present? I've been wondering about this for a long time, right now, I'm > matching the raw-header against some regex, but it breaks if the line I'm > matching contains a newline (i.e. the header field is longer than one line). Is there any reason you're not using the list_address member of message? It is derived from the List-Post header if present, or if not, the X-Mailing-List header. You can use it as, for example: # Mark by email list if message.list_address.email =~ /sup-talk/ message.add_label "sup" message.add_label "list" end Hamish _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk