grosjo / fts-xapian

Dovecot FTS plugin based on Xapian
GNU Lesser General Public License v2.1
91 stars 19 forks source link

Failed to iterate through some users #139

Closed sirAlexanderSokolov closed 9 months ago

sirAlexanderSokolov commented 11 months ago

greetings! installed plugin with your instructions. got this error on doveadm fts rescan/index -A: Error: auth-master: userdb list: User listing returned failure doveadm: Error: Failed to iterate through some users How can i fix it?

sskokorin commented 11 months ago

The /var/log/dovecot/main.log shows the following message:

Sep 08 22:18:00 auth-worker(9802): Error: conn unix:auth-worker (pid=9801,uid=116): auth-worker<3>: sql(): sql: Iterate query failed: Table 'postfix.users' doesn't exist (using built-in default iterate_query: SELECT username, domain FROM users)

This means that we can assume that the problem is in the incorrect format of the request to MySQL (in my case).

My users in MySQL are actually located in a database called “postfix” in a table called “mailbox”. So the correct query should look like SELECT username AS user FROM mailbox

My primary userdb refers to dovecot-mysql.conf, so I added the correct database query to this file with the following line:

iterate_query = SELECT username AS user FROM mailbox

a then just restart dovecot.service

This solved the issue

grosjo commented 9 months ago

great