jsuto / piler

Email archiving application
https://www.mailpiler.org/
Other
62 stars 9 forks source link

[BUG] After upgrading to 1.3.11 advanced search [from, to] not working #24

Closed dabuv closed 5 months ago

dabuv commented 5 months ago

Describe the bug After upgrading from 1.3.4 to 1.3.11 "Advanced Search" stopped not working properly. Without any filters I can see all my emails without a problem. I compared search query between 1.3.4 and 1.3.11 versions. The MATCH clause changed.

On version 1.3.4:

FROM:
piler-webui[1517]: sphinx query: 'SELECT id FROM main1,dailydelta1,delta1 WHERE        MATCH('@from adminXmydomainXcom ') ORDER BY `sent` DESC LIMIT 0,50 OPTION max_matches=1000' in 0.07 s, 50 hits, 7182 total found
TO: 
piler-webui[1386]: sphinx query: 'SELECT id FROM main1,dailydelta1,delta1 WHERE        MATCH('@to adminXmydomainXcom ') ORDER BY `sent` DESC LIMIT 0,50 OPTION max_matches=1000' in 0.15 s, 50 hits, 267150 total found

On version 1.3.11:

FROM:
piler-webui[1900]: sphinx query: 'SELECT id FROM main1,dailydelta1,delta1 WHERE        MATCH('@sender adminXmydomainXcom ') ORDER BY `sent` DESC LIMIT 0,50 OPTION max_matches=1000' in 0.00 s, 0 hits, 0 total found
TO: 
piler-webui[15982]: sphinx query: 'SELECT id FROM main1,dailydelta1,delta1 WHERE        MATCH('@rcpt adminXmydomainXcom ') ORDER BY `sent` DESC LIMIT 0,50 OPTION max_matches=1000' in 0.00 s, 0 hits, 0 total found

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Piler webUI'
  2. Click on 'Advanced Search'
  3. Paste email address in "To" or "From" field
  4. See error of no matching results
  5. Check /var/log/maillog for Sphinx query

Expected behavior After using the filter there should be listed emails.

Piler version:

piler 1.3.11, build 1001, Janos SUTO <sj@acts.hu>

Build Date: Fri Apr 5 17:35:33 CEST 2024
ldd version: ldd (GNU libc) 2.17
gcc version: gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC)
OS: Linux archive.fitnessauthority.pl 3.10.0-862.14.4.el7.x86_64 #1 SMP Wed Sep 26 15:12:11 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Configure command: ./configure --localstatedir=/var --with-database=mysql
MySQL client library version: 10.2.18
Extractors: /bin/pdftotext /bin/catdoc /bin/catppt /bin/xls2csv /usr/local/bin/ppthtml /bin/unrtf /bin/tnef libzip

Additional context Default search works as expected.

jsuto commented 5 months ago

Try setting $config['SPHINX_STRICT_SCHEMA'] = 0; in config-site.php. And define('SPHINX_STRICT_SCHEMA', 0); in sphinx.conf

dabuv commented 5 months ago

That was it. Thank You so much

jsuto commented 5 months ago

You are welcome. The next time you upgrade, I recommend a more recent version, eg. 1.4.5.