8
8
struct mailbox_list_iterate_context;
10
enum mailbox_list_properties {
11
/* maildir_name must always be empty */
12
MAILBOX_LIST_PROP_NO_MAILDIR_NAME = 0x01
10
15
enum mailbox_list_flags {
11
16
/* Print debugging information while initializing the driver */
12
17
MAILBOX_LIST_FLAG_DEBUG = 0x01,
102
107
If mailbox_name is "Maildir", you have a non-selectable mailbox
103
108
"mail" and a selectable mailbox "mail/foo". */
104
109
const char *maildir_name;
110
/* if set, store mailboxes under root_dir/mailbox_dir_name/.
111
this setting contains either "" or "dir/". */
112
const char *mailbox_dir_name;
106
114
/* If mailbox index is used, use these settings for it
107
115
(pointers, so they're set to NULL after init is finished): */
128
137
enum mailbox_list_flags flags);
129
138
void mailbox_list_deinit(struct mailbox_list *list);
131
const char *mailbox_list_get_driver_name(struct mailbox_list *list);
132
char mailbox_list_get_hierarchy_sep(struct mailbox_list *list);
133
enum mailbox_list_flags mailbox_list_get_flags(struct mailbox_list *list);
134
struct mail_namespace *mailbox_list_get_namespace(struct mailbox_list *list);
141
mailbox_list_get_driver_name(const struct mailbox_list *list) ATTR_PURE;
142
char mailbox_list_get_hierarchy_sep(const struct mailbox_list *list) ATTR_PURE;
143
enum mailbox_list_flags
144
mailbox_list_get_flags(const struct mailbox_list *list) ATTR_PURE;
145
struct mail_namespace *
146
mailbox_list_get_namespace(const struct mailbox_list *list) ATTR_PURE;
136
/* Returns the mode and GID that should be used when creating new global files
137
to the mailbox list root directories. (gid_t)-1 is returned if it's not
138
necessary to change the default */
148
/* Returns the mode and GID that should be used when creating new files to
149
the specified mailbox, or to mailbox list root if name is NULL. (gid_t)-1 is
150
returned if it's not necessary to change the default gid. */
139
151
void mailbox_list_get_permissions(struct mailbox_list *list,
140
mode_t *mode_r, gid_t *gid_r);
153
mode_t *mode_r, gid_t *gid_r,
154
const char **gid_origin_r);
155
/* Like mailbox_list_get_permissions(), but add execute-bits for mode
156
if either read or write bit is set (e.g. 0640 -> 0750). */
157
void mailbox_list_get_dir_permissions(struct mailbox_list *list,
159
mode_t *mode_r, gid_t *gid_r,
160
const char **gid_origin_r);
161
/* Create path's parent directory with proper permissions. Since most
162
directories are created lazily, this function can be used to easily create
163
them whenever file creation fails with ENOENT. */
164
int mailbox_list_create_parent_dir(struct mailbox_list *list,
165
const char *mailbox, const char *path);
142
167
/* Returns TRUE if the name doesn't contain any invalid characters.
143
168
The create name check can be more strict. */
180
205
mailbox_list_iter_init_multiple(struct mailbox_list *list,
181
206
const char *const *patterns,
182
207
enum mailbox_list_iter_flags flags);
208
/* List mailbox_list_iter_init_multiple(), but list mailboxes from all the
209
specified namespaces. */
210
struct mailbox_list_iterate_context *
211
mailbox_list_iter_init_namespaces(struct mail_namespace *namespaces,
212
const char *const *patterns,
213
enum mailbox_list_iter_flags flags);
183
214
/* Get next mailbox. Returns the mailbox name */
184
215
const struct mailbox_info *
185
216
mailbox_list_iter_next(struct mailbox_list_iterate_context *ctx);
186
/* Deinitialize mailbox list request. Returns FALSE if some error
217
/* Deinitialize mailbox list request. Returns -1 if some error
187
218
occurred while listing. */
188
219
int mailbox_list_iter_deinit(struct mailbox_list_iterate_context **ctx);
220
/* List one mailbox. Returns 1 if info returned, 0 if mailbox doesn't exist,
222
int mailbox_list_mailbox(struct mailbox_list *list, const char *name,
223
enum mailbox_info_flags *flags_r);
190
225
/* Subscribe/unsubscribe mailbox. There should be no error when
191
226
subscribing to already subscribed mailbox. Subscribing to