I need to cover some quite special scenarios here in terms of identity
selection, and therefore wanted first to understand the current logic how an
identity is being selected (in order to implement a correct and working
patch later on).
I got stuck already at first attempt. Say we have the following two messages
with their headers (please don't ask why there are two headers
"Envelope-To:", just please take it as a matter of fact):
Message #1:
----------------------------------------------
Delivery-date: Sat, 06 Jul 2013 20:29:21 +0200
Return-path: <theo1(a)tester.de>
Envelope-To: identity1(a)test.de
Envelope-To: identity2(a)test.de
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Date: Sat, 06 Jul 2013 20:29:21 +0200
From: theo1(a)tester.de
To: theo2(a)tester.de
Subject: Test #1 (Envelope-To: identity1(a)test.de, Envelope-To:
identity2(a)test.de)
Message-ID: <identity1(a)tester.de>
X-Sender: theo1(a)tester.de
User-Agent: Roundcube Webmail/1.0-git
Test - pls ignore.
----------------------------------------------
Message #2:
----------------------------------------------
Delivery-date: Sat, 06 Jul 2013 20:29:21 +0200
Return-path: <theo1(a)tester.de>
Envelope-To: identity2(a)test.de
Envelope-To: identity1(a)test.de
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Date: Sat, 06 Jul 2013 20:29:21 +0200
From: theo1(a)tester.de
To: theo2(a)tester.de
Subject: Test #1 (Envelope-To: identity2(a)test.de, Envelope-To:
identity1(a)test.de)
Message-ID: <identity2(a)tester.de>
X-Sender: theo1(a)tester.de
User-Agent: Roundcube Webmail/1.0-git
Test - pls ignore.
----------------------------------------------
Please also take it as a matter of fact that "identity1(a)test.de" and
"identity2(a)test.de" are being defined as identities in Roundcube.
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(a)test.de" is
being used as the sender in the "From:" header in both cases. Hmm...?!?
This logic escapes me and makes my life more difficult, as this behaviour is
telling me that the order (of both the same headers in the same message!)
doesn't make any difference. Is the choice being taken because of the
alphabetical order of the sender addresses (so that "identity1(a)test.de" is
preceding "identity2(a)test.de")?
At this point I stopped testing, and my next question is:
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).
Cheers,
--
Michael Heydekamp
Co-Admin freexp.de
Düsseldorf/Germany