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

[sup-talk] message.list_address weirdness



I cannot get message.list_address to match to add labels before adding
messages although the messages definitively have the List-Post header.
I found that message.list_address is sometimes a Person instance, which 
suggest a bug in the code assigning the instance variable @list_address
(reformatted):

@list_address = if header["list-post"]
                  address = if header["list-post"] =~ /mailto:(.*?)[>\s$]/
                              $1
                            elsif header["list-post"] =~ /@/
                              header["list-post"] # just try the whole fucking thing
                            end
                  address && Person.from_address(address)
                elsif header["x-mailing-list"]
                  Person.from_address header["x-mailing-list"]
                end

This code looks erroneous in that Person.from_address returns a Person
instance in the elsif branch. Shouldn't that be a string of the address
instead, i.e.,

    Person.from_address(header["x-mailing-list"]).email

? The same problem seems to appear in the conjunction

    address && Person.from_address(address)

which should in my opinion be

    address && Person.from_address(address).email

. Does that makes sense?

   Matthias
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk