Being on vacation, I finally find the time to play with the new identity_select plugin.
Works pretty well so far, but I may have found a small glitch:
For testing purposes, I have created the following identities:
identity01@test.de identity02@test.de identity03@test.de bla@test.de blubb@test.de
The config entry in config.inc.php is:
$config['identity_select_headers'] = array('x-envelope-to', 'envelope-to', 'delivered-to');
Then I create a reply to the message attached. The identity being chosen by RC is - much to my surprise - "bla@test.de". Although none of the headers does contain this identity at all. There are four headers containing the string "not_bla@test.de", of course, but this is anything but identical to "bla@test.de". Something is going wrong in terms of string comparison here.
Any other tests did produce correct results so far (I'm not finished yet with testing, though).
Michael Heydekamp Co-Admin freexp.de Düsseldorf/Germany
Am 04.08.2013 10:41, schrieb GitHub:
Branch: refs/heads/master Home: https://github.com/roundcube/roundcubemail Commit: b825f86108a91957f6467176e418cfc257874658
https://github.com/roundcube/roundcubemail/commit/b825f86108a91957f6467176e4... Author: Aleksander Machniak alec@alec.pl Date: 2013-08-04 (Sun, 04 Aug 2013)
Changed paths: M CHANGELOG A plugins/identity_select/identity_select.php A plugins/identity_select/package.xml A plugins/identity_select/tests/IdentitySelect.php M program/lib/Roundcube/rcube_storage.php M program/steps/mail/func.inc
Log Message:
Move identity selection based on non-standard headers into (new) identity_select plugin (#1488553)
Roundcube SVN commits mailing list svn@lists.roundcube.net http://lists.roundcube.net/mailman/listinfo/svn
On 10/13/2013 08:23 PM, Michael Heydekamp wrote:
Then I create a reply to the message attached. The identity being chosen by RC is - much to my surprise - "bla@test.de". Although none of the headers does contain this identity at all. There are four headers containing the string "not_bla@test.de", of course, but this is anything but identical to "bla@test.de". Something is going wrong in terms of string comparison here.
Yes, for Return-Path we use stripos(). Other headers are checked in a different way. Create a ticket, please.
Am 14.10.2013 09:01, schrieb A.L.E.C:
On 10/13/2013 08:23 PM, Michael Heydekamp wrote:
Then I create a reply to the message attached. The identity being chosen by RC is - much to my surprise - "bla@test.de". Although none of the headers does contain this identity at all. There are four headers containing the string "not_bla@test.de", of course, but this is anything but identical to "bla@test.de". Something is going wrong in terms of string comparison here.
Yes, for Return-Path we use stripos(). Other headers are checked in a different way. Create a ticket, please.
Done.
I can of course test it, but it would save me some time if you'd tell me: Which standard headers are checked in which order? At least Return-path is not an obvious one.
Michael Heydekamp Co-Admin freexp.de Düsseldorf/Germany
On 10/14/2013 09:46 AM, Michael Heydekamp wrote:
I can of course test it, but it would save me some time if you'd tell me: Which standard headers are checked in which order? At least Return-path is not an obvious one.
First we check To and Cc (and From) then Return-Path and that's all.
Am 14.10.2013 09:56, schrieb A.L.E.C:
On 10/14/2013 09:46 AM, Michael Heydekamp wrote:
I can of course test it, but it would save me some time if you'd tell me: Which standard headers are checked in which order? At least Return-path is not an obvious one.
First we check To and Cc (and From) then Return-Path and that's all.
Thanks. But are you sure about "From"? During my tests I didn't manage to select the identity in the From: header at all. The default identity had been selected instead (unless From: and Return-path: were identical).
Michael Heydekamp Co-Admin freexp.de Düsseldorf/Germany
On 10/14/2013 10:47 AM, Michael Heydekamp wrote:
Thanks. But are you sure about "From"? During my tests I didn't manage to select the identity in the From: header at all. The default identity had been selected instead (unless From: and Return-path: were identical).
Well, From header check matches full mailbox spec., e.g. "Roundcube Users dev@lists.roundcube.net".
This is because we want to handle correctly situation when user has many identities with same address but different name. It's not perfect and I'm not saying we don't need an improvement here.
Am 14.10.2013 11:03, schrieb A.L.E.C:
On 10/14/2013 10:47 AM, Michael Heydekamp wrote:
Thanks. But are you sure about "From"? During my tests I didn't manage to select the identity in the From: header at all. The default identity had been selected instead (unless From: and Return-path: were identical).
Well, From header check matches full mailbox spec., e.g. "Roundcube Users dev@lists.roundcube.net".
This is because we want to handle correctly situation when user has many identities with same address but different name.
Aha...! Is this also the logic how an "own message" is being detected?
I wasn't aware that it's possible at all to have more than one identity with the same address. Not the worst idea, I could indeed want to make use of it.
It's not perfect and I'm not saying we don't need an improvement here.
Right, although I don't have a better logic at hand right now.
As I'm thinking of it...: What happens if I have two identities with the same address, both match the address in the To: header (but none of them matches the full mailbox spec, if that should be checked at all as a last resort)? Which identity is selected then?
Michael Heydekamp Co-Admin freexp.de Düsseldorf/Germany
On 10/14/2013 11:50 AM, Michael Heydekamp wrote:
Aha...! Is this also the logic how an "own message" is being detected?
yes.
As I'm thinking of it...: What happens if I have two identities with the same address, both match the address in the To: header (but none of them matches the full mailbox spec, if that should be checked at all as a last resort)? Which identity is selected then?
For To/Cc the matching is different. We check addresses, but give bigger prio to identity where address+name matches. So, here we're safe. I suppose we could do the same for From with some more coding. Feel free to create a ticket.
Am 14.10.2013 12:03, schrieb A.L.E.C:
On 10/14/2013 11:50 AM, Michael Heydekamp wrote:
As I'm thinking of it...: What happens if I have two identities with the same address, both match the address in the To: header (but none of them matches the full mailbox spec, if that should be checked at all as a last resort)? Which identity is selected then?
For To/Cc the matching is different. We check addresses, but give bigger prio to identity where address+name matches. So, here we're safe.
What I meant (and said), was something like this:
Identity #1: First Name identity01@test.de Identity #2: Last Name identity01@test.de "To:" header: No Name identity01@test.de
So there is no match of address+name between To: header and any of the identities. Which identity will be selected?
In this example, "First Name identity01@test.de" gets selected. But I'm not sure if this is random, or if there's any logic or rule behind this.
I suppose we could do the same for From with some more coding. Feel free to create a ticket.
I can do it, just not sure how to phrase it. It's neither a bug nor a feature, more a call for optimization.
Michael Heydekamp Co-Admin freexp.de Düsseldorf/Germany
On 10/14/2013 02:30 PM, Michael Heydekamp wrote:
What I meant (and said), was something like this:
Identity #1: First Name identity01@test.de Identity #2: Last Name identity01@test.de "To:" header: No Name identity01@test.de
So there is no match of address+name between To: header and any of the identities. Which identity will be selected?
First on the list (or chunk of the list for address matching). The list of identities is sorted by "name ASC, identity_id ASC" with exception to default identity which is always first.