Hello,

The IMAP clients likely transmit a too complex search query with too much 
clauses and Lucene refuses to execute such a complex query.

This is what you want! We want the search engine to be protected from denial of 
service attacks: this might have been what you noticed.

I'm interested by the IMAP contextual logs especially the MUA declared by the 
ID command, the exact search query that triggered the error.

--


Best regards,



Benoit TELLIER



General manager of Linagora VIETNAM.

Product owner for Team-Mail product.

Chairman of the Apache James project.



Mail: btell...@linagora.com

Tel: (0033) 6 77 26 04 58 (WhatsApp, Signal)


On Jul 18, 2023 12:04 PM, from Mihai Zamfira Hello.
I use the latest version available on github of apache james jpa-guice which is 
integrated with LDAP and an external rdbms.
I get the following errors when mobile clients access the account via IMAP. The 
emails are downloaded to the phone, but in the log there are errors of the form 
below.
I don't know if this is specific only to the Iphone or not.


07:51:39.182 [ERROR] o.a.j.i.p.AbstractMailboxProcessor - Unexpected error 
during IMAP processing
org.apache.lucene.search.BooleanQuery$TooManyClauses: maxClauseCount is set to 
1024
        at org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:136)
        at org.apache.lucene.search.BooleanQuery.add(BooleanQuery.java:127)
        at 
org.apache.james.mailbox.lucene.search.LuceneMessageSearchIndex.createUidQuery(LuceneMessageSearchIndex.java:949)
        at 
org.apache.james.mailbox.lucene.search.LuceneMessageSearchIndex.createFlagQuery(LuceneMessageSearchIndex.java:1023)
        at 
org.apache.james.mailbox.lucene.search.LuceneMessageSearchIndex.createQuery(LuceneMessageSearchIndex.java:1208)
        at 
org.apache.james.mailbox.lucene.search.LuceneMessageSearchIndex.searchMultimap(LuceneMessageSearchIndex.java:523)
        at 
org.apache.james.mailbox.lucene.search.LuceneMessageSearchIndex.doSearch(LuceneMessageSearchIndex.java:491)
        at 
org.apache.james.mailbox.store.search.ListeningMessageSearchIndex.lambda$search$2(ListeningMessageSearchIndex.java:84)
        at 
com.github.fge.lambdas.supplier.SupplierChainer.lambda$sneakyThrow$195(SupplierChainer.java:74)
        at java.base/java.util.Optional.orElseGet(Optional.java:369)
        at 
org.apache.james.mailbox.store.search.ListeningMessageSearchIndex.search(ListeningMessageSearchIndex.java:84)
        at 
org.apache.james.mailbox.store.StoreMessageManager.search(StoreMessageManager.java:837)
        at 
org.apache.james.mailbox.store.StoreMessageManager.search(StoreMessageManager.java:132)
        at 
org.apache.james.imap.processor.SearchProcessor.performUidSearch(SearchProcessor.java:263)
        at 
org.apache.james.imap.processor.SearchProcessor.lambda$processRequestReactive$2(SearchProcessor.java:105)
        at 
com.github.fge.lambdas.functions.FunctionChainer.doApply(FunctionChainer.java:20)
        at 
com.github.fge.lambdas.functions.ThrowingFunction.apply(ThrowingFunction.java:17)
        at 
reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:132)
        at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122)
        at 
reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)
        at 
reactor.core.publisher.FluxSubscribeOnCallable$CallableSubscribeOnSubscription.run(FluxSubscribeOnCallable.java:251)
        at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68)
        at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at 
java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)
---------------------------------------------------------------------
To unsubscribe, e-mail: server-user-unsubscr...@james.apache.org
For additional commands, e-mail: server-user-h...@james.apache.org


Reply via email to