sup
sup copied to clipboard
Multiple From: headers are ignored
Raw header:
From: siefca <siefca@localhost>, PW <pw@otherhost>
Is mapped to:
From: siefca <siefca@localhost>
However, according to RFC 5322:
from = "From:" mailbox-list CRLF
mailbox-list = (mailbox *("," mailbox)) / obs-mbox-list
So the e-mail client should display all of them and behave like in reply-all for each when hitting reply.
Same goes for hooks (that's how I found it). IMHO we should treat From: header analogously to To: header.
Many people are using hooks already so I'm wondering if it shouldn't be additional reader, like froms
or all_from
.
Or let's make use of method_missing
on decorated array and fall back to its first element.
Something like that should do:
class PersonsProxy < Array
Person.public_instance_methods(false).each do |meth|
define_method(meth) do |*args|
first and first.public_send(meth, *args)
end
end
def to_s
first.to_s
end
end
Just realized that changes would also require changes in index.
Changing the index might be necessary if from_all is supposed to be in there. But the message is loaded anyway, so unless it should be searchable (which it should...), we could populate from_all in parse_header and send it to the hook as a separate variable?