[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sup-talk] best method for before-add-message.rb



> 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