[sup-talk] [PATCH] New hook to allow formatting of message headers

William Morgan wmorgan-sup at masanjin.net
Wed Dec 5 13:12:16 EST 2007


Hi Colin,

Excerpts from Colin Bell's message of Tue Nov 20 20:26:40 -0800 2007:
> This patch allows you to format the headers shown in the Detailed
> Headers view. Also attached is an example hook which will show the
> email client and a spam header.

I've applied this to SVN trunk, but (as I am wont to do) I tweaked it a
bit. I renamed it "detailed-headers" and changed the arguments so that
you get, and return, a hash rather than an array, which I think is a
little friendlier.

Here's the new version of your hook:

  $ cat /detailed-headers.rb 
  ["User-Agent", "X-Mailer", "X-Spam-Status"].map do |key|
    if message.raw_header =~ /^#{key}: (.*)$/i
      headers[key] = $1
    end
  end

-- 
William <wmorgan-sup at masanjin.net>


More information about the sup-talk mailing list