From mboxrd@z Thu Jan 1 00:00:00 1970 From: nicolas.pouillard@gmail.com (Nicolas Pouillard) Date: Thu, 06 Dec 2007 18:12:09 +0100 Subject: [sup-talk] [PATCH] New hook to allow formatting of message headers In-Reply-To: <1196879746-sup-2883@south> References: <1195618839-sup-4347@lankhmar> <1196878151-sup-6754@south> <1196879746-sup-2883@south> Message-ID: <1196960854-sup-7925@192.117.33.51.static.012.net.il> Excerpts from William Morgan's message of Wed Dec 05 19:36:44 +0100 2007: > Excerpts from William Morgan's message of Wed Dec 05 10:12:16 -0800 2007: > > I've applied this to SVN trunk, but (as I am wont to do) I tweaked it a > > bit. > > Tweaked it a little more to use an OrderedHash and to just modify the > headers in place. This way the header ordering is not random. > > Here's the new hook: > > $ cat detailed-headers.rb > %w(User-Agent X-Mailer X-Spam-Status).map do |key| Why use .map instead of .each the result seems not that useful. > if message.raw_header =~ /^#{key}: (.*)$/i > headers[key] = $1 > end > end > -- Nicolas Pouillard aka Ertai From mboxrd@z Thu Jan 1 00:00:00 1970 From: nicolas.pouillard@gmail.com (Nicolas Pouillard) Date: Thu, 06 Dec 2007 18:14:52 +0100 Subject: [sup-talk] [PATCH] New hook to allow formatting of message headers In-Reply-To: <1196879746-sup-2883@south> References: <1195618839-sup-4347@lankhmar> <1196878151-sup-6754@south> <1196879746-sup-2883@south> Message-ID: <1196960854-sup-7925@192.117.33.51.static.012.net.il> Message-ID: <20071206171452.otf7p7kvdbE3axpqo_yho1ZB3wYYU9Fou-Yc1N5YcRg@z> Excerpts from William Morgan's message of Wed Dec 05 19:36:44 +0100 2007: > Excerpts from William Morgan's message of Wed Dec 05 10:12:16 -0800 2007: > > I've applied this to SVN trunk, but (as I am wont to do) I tweaked it a > > bit. > > Tweaked it a little more to use an OrderedHash and to just modify the > headers in place. This way the header ordering is not random. > > Here's the new hook: > > $ cat detailed-headers.rb > %w(User-Agent X-Mailer X-Spam-Status).map do |key| Why use .map instead of .each the result seems not that useful. > if message.raw_header =~ /^#{key}: (.*)$/i > headers[key] = $1 > end > end > -- Nicolas Pouillard aka Ertai