}
d = opendir(dir);
+ if (d == NULL && errno == ENOENT) {
+ /* FIXME: the PATH_TYPE_CONTROL should come as a parameter, but
+ that's an API change, do it in v2.3. it's not really a
+ problem though, since currently all backends use control
+ dirs for the uidvalidity file. */
+ (void)mailbox_list_mkdir_root(list, dir, MAILBOX_LIST_PATH_TYPE_CONTROL);
+ d = opendir(dir);
+ }
if (d == NULL) {
i_error("opendir(%s) failed: %m", dir);
return mailbox_uidvalidity_next_fallback();