<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello there</p>
<p>We stumbled upon an user account with Solr FTS, which returned no
search results for any given search query.<br>
Further investigation revealed an issue between indexing mails and
querying the index.<br>
The user name contains upper and lower case characters (eg.
<a class="moz-txt-link-abbreviated" href="mailto:Some.User@domain.net">Some.User@domain.net</a>).</p>
<p>When new mail is indexed for this user, the user name used for
Solr's `user` and `id` fields are transformed into lowercase, as
shown in the Solr log:</p>
<div><font face="monospace"><span style="color: #d4d4d4;">webapp=/solr
path=/update params={...}{</span><span style="color: #569cd6;">add</span><span
style="color: #d4d4d4;">=[<a class="moz-txt-link-abbreviated" href="mailto:8543/426f3b0348d03451a3fb00008ba2b673/some.user@domain.net">8543/426f3b0348d03451a3fb00008ba2b673/some.user@domain.net</a>
(1724281617442144256), ... (162 adds)]} 0 44298</span></font><span
style="color: #d4d4d4;"><br>
</span></div>
<div><span style="color: #d4d4d4;"><br>
</span></div>
<div><span style="color: #d4d4d4;">And can be confirmed by manually
querying Solr. The Solr schema in use performs no transformation
for the affected fields.<br>
</span></div>
<div><span style="color: #d4d4d4;">When a search request is
performed via IMAP, Dovecot queries Solr with the original user
name:<br>
</span></div>
<div><span style="color: #d4d4d4;"><br>
</span></div>
<div><span style="color: #d4d4d4;"><font face="monospace">GET
/solr/dovecot_fts_popimap/select?wt=json&f...&fq=%2Bbox:1a30ec359dce3451b8e600008ba2b673+%2Buser:Some.User@domain.net
HTTP/1.1"</font><br>
</span></div>
<div><span style="color: #d4d4d4;"><br>
</span></div>
<div><span style="color: #d4d4d4;">Which (correctly) returns zero
results.<br>
</span></div>
<div><span style="color: #d4d4d4;"><br>
</span></div>
<div><span style="color: #d4d4d4;">To summarize, I suspect dovecot
transforms any user name to lower case while indexing mails, but
not when querying for results.<br>
</span></div>
<div><span style="color: #d4d4d4;"><br>
Is this a bug, or caused by misconfiguration?<br>
<br>
</span></div>
<div><span style="color: #d4d4d4;">Regards<br>
Patrik<br>
</span></div>
</body>
</html>