maildir-list.c revision dae702b7ff81cf38291d4f2cb49334bfaf5cc1ba
/* Copyright (C) 2002 Timo Sirainen */
#include "lib.h"
#include "hostpid.h"
#include "home-expand.h"
#include "unlink-directory.h"
#include "imap-match.h"
#include "subscription-file/subscription-file.h"
#include "maildir-index.h"
#include "maildir-storage.h"
#include <dirent.h>
struct mailbox_list_context {
struct mail_storage *storage;
enum mailbox_list_flags flags;
struct imap_match_glob *glob;
struct subsfile_list_context *subsfile_ctx;
struct mailbox_list list;
int failed;
};
{
/* assume marked if new/ has been modified later than cur/ */
return MAILBOX_UNMARKED;
return MAILBOX_UNMARKED;
}
struct mailbox_list_context *
int *sorted)
{
struct mailbox_list_context *ctx;
const char *dir, *p;
if ((flags & MAILBOX_LIST_SUBSCRIBED) != 0) {
return NULL;
}
return ctx;
}
} else {
}
return NULL;
}
return ctx;
}
{
int failed;
else
return !failed;
}
{
break;
}
return NULL;
if (match == IMAP_MATCH_PARENT) {
/* placeholder */
}
}
i_unreached();
}
t_push();
else {
else
}
t_pop();
}
{
struct dirent *d;
const char *fname, *p;
enum imap_match_result match;
return NULL;
if (fname[0] != '.')
continue;
/* skip . and .. */
continue;
/* make sure the mask matches - dirs beginning with ".."
should be deleted and we always want to check those. */
t_push();
t_pop();
continue;
continue;
/* make sure it's a directory */
continue; /* just deleted, ignore */
"stat(%s) failed: %m", path);
return NULL;
}
continue;
fname++;
if (*fname == '.') {
/* this mailbox is in the middle of being deleted,
or the process trying to delete it had died.
delete it ourself if it's been there longer than
one hour. don't touch it if it's outside our
mail root dir. */
continue;
}
continue; /* ignore inboxes */
if (match == IMAP_MATCH_PARENT) {
}
}
i_unreached();
}
maildir_get_marked_flags(path) : 0;
}
}
maildir_get_marked_flags(path) : 0;
}
/* we're finished */
return NULL;
}
struct mailbox_list *
{
}