sup icon indicating copy to clipboard operation
sup copied to clipboard

Multiple From: headers are ignored

Open siefca opened this issue 11 years ago • 3 comments

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.

siefca avatar Nov 25 '13 16:11 siefca

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.

siefca avatar Nov 25 '13 16:11 siefca

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.

siefca avatar Nov 26 '13 00:11 siefca

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?

gauteh avatar Nov 26 '13 07:11 gauteh