From: marcus-sup@bar-coded.net (Marcus Williams)
Subject: [sup-talk] [PATCH] Add list-id as a new property of messages
Date: Thu, 24 Apr 2008 09:54:53 +0100 [thread overview]
Message-ID: <1209026545-sup-9368@tomsk> (raw)
In-Reply-To: <1208985725-sup-6028@elly>
On 23.4.2008, Israel Herraiz wrote:
> I am using list_address.email to automatically generate labels for
> messages that are coming from mailing lists (that field uses the value
> of the List-Post header of the raw message). It seems that some
> mailing lists are not including that header though. In those lists
> where I do not see List-Post, I have found that List-Id is still
> present. Therefore I propose to add that header to the message class
> for filtering purposes.
Adding list-id is a good idea I think but you cant do a personmanager
lookup with it because it isnt really an email address according to
the RFC [1]. List-Subscribe and List-Unsubscribe all set their
counterparts in message.rb to the raw header so this is what I would
expect list_id to get set to.
[snip]
> @@ -128,6 +128,12 @@ class Message
> @source_marked_read = header["status"] == "RO"
> @list_subscribe = header["list-subscribe"]
> @list_unsubscribe = header["list-unsubscribe"]
> + @list_id =
> + if header["list-id"]
> + @list_id = PersonManager.person_for header["list-id"]
> + else
> + nil
> + end
> end
> private :parse_header
[snip]
If you are labeling via list-id you just want the raw header so this
should just be
@list_id = header["list-id"]
Then if you want to do a lookup you can do it in the
before-add-message hook.
Marcus
[1] http://www.apps.ietf.org/rfc/rfc2919.html
next prev parent reply other threads:[~2008-04-24 8:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-23 21:23 Israel Herraiz
2008-04-24 8:54 ` Marcus Williams [this message]
2008-04-25 20:46 ` Israel Herraiz
2008-04-25 21:15 ` Marcus Williams
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1209026545-sup-9368@tomsk \
--to=marcus-sup@bar-coded.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox