cyrusimap / cyrus-imapd

Cyrus IMAP is an email, contacts and calendar server
http://cyrusimap.org
Other
531 stars 145 forks source link

List of sieve scripts got out of sync with the #sieve folder #4935

Open alecpl opened 3 months ago

alecpl commented 3 months ago

Cyrus 3.6.3 with Murder.

For some reason the list of scripts stored in the sqlite index got out-of-sync with the content of the #sieve folder. It might have been our fault when we did some data migration. Right now we can't say it got broken during normal operation.

To find out what's going on encountered some issues:

  1. reconstructing the #sieve folder didn't fix the issue (it did not de-activate nor remove records from sieve_scripts table).
  2. dav.db file is not mentioned at https://www.cyrusimap.org/3.8/imap/concepts/deployment/databases.html, sieve is mentioned in DAV Index (<userid>.dav) section, but the file is dav.db not <userid>.dav. If it was properly documented or the file was sieve.db we would find the issue faster.
  3. maybe accessing a sieve script that exists in the sieve_scripts table, but not in the #sieve folder should trigger re-sync?

It would be much easier if 1. or 3. just worked for this case, but documentation could be clearer too.

ksmurchison commented 2 months ago

Did you try a dav_reconstruct on the user in question? dav_reconstruct is what updates the DAV DB.

alecpl commented 2 months ago

It wasn't me dealing with the server, but I believe my colleague used just the normal reconstruct on the folder, not dav_reconstruct on a user.