Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2.5.11] squatter -r fails recursing over #addressbooks and #calendars #2185

Open
MASHtm opened this issue Oct 27, 2017 · 3 comments
Open

[2.5.11] squatter -r fails recursing over #addressbooks and #calendars #2185

MASHtm opened this issue Oct 27, 2017 · 3 comments
Assignees
Labels
2.5 affects 2.5

Comments

@MASHtm
Copy link
Contributor

MASHtm commented Oct 27, 2017

If a mailbox has a global "squat: true" setting which is inherited by all children squatter -r fails reaching 'user.<uid>.#addressbooks*' or 'user.<uid>.#calendars*' because index_open() returns IMAP_MAILBOX_BADTYPE and squatter quits immediately after getting this error.

A workarround is to set "squat: false" on these mailboxes, but this is pretty difficult since they are autogenerated on first access.

I think this fixes it correctly:

--- a/imap/squatter.c   2017-05-09 02:40:13.000000000 +0200
+++ b/imap/squatter.c   2017-10-27 15:07:18.228433175 +0200
@@ -552,7 +552,8 @@

         return 1;
     }
-    if (mbentry->mbtype & MBTYPE_REMOTE) {
+    if ((mbentry->mbtype & MBTYPE_REMOTE) ||
+        (mbentry->mbtype & MBTYPES_NONIMAP )) {
        mboxlist_entry_free(&mbentry);
        return 0;
     }

Works fine here.

@elliefm elliefm self-assigned this Nov 9, 2017
@elliefm elliefm added 2.5 affects 2.5 3.0 affects 3.0 3.1 affects 3.1 dev releases labels Nov 9, 2017
@elliefm
Copy link
Contributor

elliefm commented Nov 9, 2017

I've merged this into 2.5, thanks!

I'm not sure if this is needed on 3.0/master -- index_open_mailbox() on these versions has some handling to support opening non-imap mailboxes under certain circumstances (with imapmagicplus stuff), so I'm not sure if it's right for squatter to just ignore them, or to try to factor that in.

@elliefm elliefm removed 3.0 affects 3.0 3.1 affects 3.1 dev releases labels Nov 9, 2017
@elliefm
Copy link
Contributor

elliefm commented Jan 17, 2018

@rsto @ksmurchison I'd appreciate any input either of you might have to offer here, regarding squatter indexing of #addressbooks/#calendars. Does anything need to be done for the 3.0 and master branches?

@rsto
Copy link
Member

rsto commented Jan 17, 2018

In version 3, we index selected text fields from iCalendar messages in #calendars. E.g. here is the code in index.c. So we shouldn't skip over non-mail mailboxes.

I haven't tested what happens if HTTP support isn't enabled, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.5 affects 2.5
Projects
None yet
Development

No branches or pull requests

3 participants