On 07/06/2013 10:58 PM, Michael Heydekamp wrote:
The main difference between these two messages is the order of the "Envelope-To:" headers. But apparently that doesn't make any difference at all, as when replying to these messages, the identity "identity1@test.de" is being used as the sender in the "From:" header in both cases. Hmm...?!?
See line 1905-1812 of steps/mail/func.inc (git-master). It matches the header value with identities in identities order. I suppose this is good because we give a precedence to default identity which is first on the list here.
As I'm able to create any custom header right before delivery, how can I make sure that this - and only this - custom header will be respected with regards to identity selection, disregarding any other headers/addresses and the entire rest of the logic...?
This would be a private patch, of course. Any help and hint appreciated, for I'm a noob in terms of PHP (= I have an idea of the logic, but just can't code it).
Maybe a hook for plugin at the end of rcmail_identity_select() function would be the best solution for you. I'd call it 'identity_select' or 'message_compose_identity'.