annotate src/lib-storage/index/shared/shared-storage.c @ 8319:8553bb4c53ad HEAD

Fixed shared mailboxes to work with plugins.
author Timo Sirainen <tss@iki.fi>
date Thu, 23 Oct 2008 20:15:16 +0300
parents 4296aa3fbb75
children b46cf0979768
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8173
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
1 /* Copyright (c) 2008 Dovecot authors, see the included COPYING file */
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
2
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3 #include "lib.h"
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
4 #include "array.h"
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
5 #include "str.h"
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
6 #include "var-expand.h"
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
7 #include "shared-storage.h"
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
8
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
9 #define SHARED_LIST_CONTEXT(obj) \
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
10 MODULE_CONTEXT(obj, shared_mailbox_list_module)
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
11
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
12 extern struct mail_storage shared_storage;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
13 extern struct mailbox shared_mailbox;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
14
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
15 static MODULE_CONTEXT_DEFINE_INIT(shared_mailbox_list_module,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
16 &mailbox_list_module_register);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
17
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
18 static struct mail_storage *shared_alloc(void)
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
19 {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
20 struct shared_storage *storage;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
21 pool_t pool;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
22
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
23 pool = pool_alloconly_create("shared storage", 256);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
24 storage = p_new(pool, struct shared_storage, 1);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
25 storage->storage = shared_storage;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
26 storage->storage.pool = pool;
8319
8553bb4c53ad Fixed shared mailboxes to work with plugins.
Timo Sirainen <tss@iki.fi>
parents: 8291
diff changeset
27 storage->storage.storage_class = &shared_storage;
8173
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
28
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
29 return &storage->storage;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
30 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
31
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
32 static int shared_create(struct mail_storage *_storage, const char *data,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
33 const char **error_r)
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
34 {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
35 struct shared_storage *storage = (struct shared_storage *)_storage;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
36 struct mailbox_list_settings list_set;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
37 const char *driver, *p;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
38 bool have_username;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
39
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
40 /* data must begin with the actual mailbox driver */
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
41 p = strchr(data, ':');
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
42 if (p == NULL) {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
43 *error_r = "Shared mailbox location not prefixed with driver";
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
44 return -1;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
45 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
46 driver = t_strdup_until(data, p);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
47 storage->location = p_strdup(_storage->pool, data);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
48 storage->storage_class = mail_storage_find_class(driver);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
49 if (storage->storage_class == NULL) {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
50 *error_r = t_strconcat("Unknown shared storage driver: ",
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
51 driver, NULL);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
52 return -1;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
53 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
54 _storage->mailbox_is_file = storage->storage_class->mailbox_is_file;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
55
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
56 p = strchr(_storage->ns->prefix, '%');
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
57 if (p == NULL) {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
58 *error_r = "Shared namespace prefix doesn't contain %";
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
59 return -1;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
60 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
61 storage->ns_prefix_pattern = p_strdup(_storage->pool, p);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
62 _storage->ns->prefix = p_strdup_until(_storage->ns->user->pool,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
63 _storage->ns->prefix, p);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
64
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
65 have_username = FALSE;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
66 for (p = storage->ns_prefix_pattern; *p != '\0'; p++) {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
67 if (*p != '%')
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
68 continue;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
69 if (*++p == '\0')
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
70 break;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
71 if (*p == 'u' || *p == 'n')
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
72 have_username = TRUE;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
73 else if (*p != 'd')
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
74 break;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
75 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
76 if (*p != '\0') {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
77 *error_r = "Shared namespace prefix contains unknown variables";
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
78 return -1;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
79 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
80 if (!have_username) {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
81 *error_r = "Shared namespace prefix doesn't contain %u or %n";
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
82 return -1;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
83 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
84
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
85 if (mailbox_list_alloc("shared", &_storage->list, error_r) < 0)
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
86 return -1;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
87 MODULE_CONTEXT_SET_FULL(_storage->list, shared_mailbox_list_module,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
88 storage, &storage->list_module_ctx);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
89
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
90 memset(&list_set, 0, sizeof(list_set));
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
91 list_set.mail_storage_flags = &_storage->flags;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
92 list_set.lock_method = &_storage->lock_method;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
93 mailbox_list_init(_storage->list, _storage->ns, &list_set,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
94 mail_storage_get_list_flags(_storage->flags));
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
95 return 0;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
96 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
97
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
98 int shared_storage_get_namespace(struct mail_storage *_storage,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
99 const char **_name,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
100 struct mail_namespace **ns_r)
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
101 {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
102 struct shared_storage *storage = (struct shared_storage *)_storage;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
103 struct mail_user *user = _storage->ns->user;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
104 static struct var_expand_table static_tab[] = {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
105 { 'u', NULL },
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
106 { 'n', NULL },
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
107 { 'd', NULL },
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
108 { '\0', NULL }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
109 };
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
110 struct var_expand_table *tab;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
111 struct mail_namespace *ns;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
112 const char *domain = NULL, *username = NULL, *userdomain = NULL;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
113 const char *name, *p, *next, **dest, *error;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
114 string_t *prefix, *location;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
115
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
116 p = storage->ns_prefix_pattern;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
117 for (name = *_name; *p != '\0';) {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
118 if (*p != '%') {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
119 if (*p != *name)
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
120 return -1;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
121 p++; name++;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
122 continue;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
123 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
124 switch (*++p) {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
125 case 'd':
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
126 dest = &domain;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
127 break;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
128 case 'n':
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
129 dest = &username;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
130 break;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
131 case 'u':
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
132 dest = &userdomain;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
133 break;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
134 default:
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
135 /* we checked this already above */
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
136 i_unreached();
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
137 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
138 p++;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
139
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
140 next = strchr(name, *p != '\0' ? *p : _storage->ns->sep);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
141 if (next == NULL)
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
142 return -1;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
143
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
144 *dest = t_strdup_until(name, next);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
145 name = next;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
146 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
147 /* successfully matched the name. */
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
148 if (userdomain == NULL) {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
149 i_assert(username != NULL);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
150 userdomain = domain == NULL ? username :
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
151 t_strconcat(username, "@", domain, NULL);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
152 } else {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
153 domain = strchr(userdomain, '@');
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
154 if (domain == NULL)
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
155 username = userdomain;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
156 else {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
157 username = t_strdup_until(userdomain, domain);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
158 domain++;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
159 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
160 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
161
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
162 /* expand the namespace prefix and see if it already exists.
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
163 this should normally happen only when the mailbox is being opened */
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
164 tab = t_malloc(sizeof(static_tab));
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
165 memcpy(tab, static_tab, sizeof(static_tab));
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
166 tab[0].value = userdomain;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
167 tab[1].value = username;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
168 tab[2].value = domain;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
169 prefix = t_str_new(128);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
170 str_append(prefix, _storage->ns->prefix);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
171 var_expand(prefix, storage->ns_prefix_pattern, tab);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
172
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
173 ns = mail_namespace_find_prefix(user->namespaces, str_c(prefix));
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
174 if (ns != NULL) {
8254
c465b10a76fd Shared mailboxes: First mailbox access failed if virtual separator didn't match real separator.
Timo Sirainen <tss@iki.fi>
parents: 8173
diff changeset
175 *_name = mail_namespace_fix_sep(ns, name);
8173
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
176 *ns_r = ns;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
177 return 0;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
178 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
179
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
180 /* create the new namespace */
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
181 ns = p_new(user->pool, struct mail_namespace, 1);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
182 ns->type = NAMESPACE_SHARED;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
183 ns->user = user;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
184 ns->prefix = p_strdup(user->pool, str_c(prefix));
8291
4296aa3fbb75 Subscription handling fixes for subscriptions=no namespaces and shared mailboxes.
Timo Sirainen <tss@iki.fi>
parents: 8254
diff changeset
185 ns->flags = NAMESPACE_FLAG_LIST | NAMESPACE_FLAG_HIDDEN |
4296aa3fbb75 Subscription handling fixes for subscriptions=no namespaces and shared mailboxes.
Timo Sirainen <tss@iki.fi>
parents: 8254
diff changeset
186 NAMESPACE_FLAG_AUTOCREATED;
8254
c465b10a76fd Shared mailboxes: First mailbox access failed if virtual separator didn't match real separator.
Timo Sirainen <tss@iki.fi>
parents: 8173
diff changeset
187 ns->sep = _storage->ns->sep;
8173
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
188
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
189 location = t_str_new(256);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
190 var_expand(location, storage->location, tab);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
191 if (mail_storage_create(ns, NULL, str_c(location), _storage->flags,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
192 _storage->lock_method, &error) < 0) {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
193 i_error("Namespace '%s': %s", ns->prefix, error);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
194 return -1;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
195 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
196 /* FIXME: we could remove namespaces here that don't have usable
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
197 mailboxes. otherwise the memory usage could just keep growing. */
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
198 mail_user_add_namespace(user, ns);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
199
8254
c465b10a76fd Shared mailboxes: First mailbox access failed if virtual separator didn't match real separator.
Timo Sirainen <tss@iki.fi>
parents: 8173
diff changeset
200 *_name = mail_namespace_fix_sep(ns, name);
8173
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
201 *ns_r = ns;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
202 return 0;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
203 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
204
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
205 static void shared_mailbox_copy_error(struct mail_storage *shared_storage,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
206 struct mail_namespace *backend_ns)
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
207 {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
208 const char *str;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
209 enum mail_error error;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
210
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
211 str = mail_storage_get_last_error(backend_ns->storage, &error);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
212 mail_storage_set_error(shared_storage, error, str);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
213 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
214
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
215 static struct mailbox *
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
216 shared_mailbox_open(struct mail_storage *storage, const char *name,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
217 struct istream *input, enum mailbox_open_flags flags)
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
218 {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
219 struct mail_namespace *ns;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
220 struct mailbox *box;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
221
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
222 if (input != NULL) {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
223 mail_storage_set_critical(storage,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
224 "Shared storage doesn't support streamed mailboxes");
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
225 return NULL;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
226 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
227
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
228 if (shared_storage_get_namespace(storage, &name, &ns) < 0)
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
229 return NULL;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
230
8319
8553bb4c53ad Fixed shared mailboxes to work with plugins.
Timo Sirainen <tss@iki.fi>
parents: 8291
diff changeset
231 /* if we call the normal mailbox_open() here the plugins will see
8553bb4c53ad Fixed shared mailboxes to work with plugins.
Timo Sirainen <tss@iki.fi>
parents: 8291
diff changeset
232 mailbox_open() called twice and they could break. */
8553bb4c53ad Fixed shared mailboxes to work with plugins.
Timo Sirainen <tss@iki.fi>
parents: 8291
diff changeset
233 box = ns->storage->storage_class->v.
8553bb4c53ad Fixed shared mailboxes to work with plugins.
Timo Sirainen <tss@iki.fi>
parents: 8291
diff changeset
234 mailbox_open(ns->storage, name, NULL, flags);
8173
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
235 if (box == NULL)
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
236 shared_mailbox_copy_error(storage, ns);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
237 return box;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
238 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
239
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
240 static int shared_mailbox_create(struct mail_storage *storage,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
241 const char *name, bool directory)
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
242 {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
243 struct mail_namespace *ns;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
244 int ret;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
245
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
246 if (shared_storage_get_namespace(storage, &name, &ns) < 0)
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
247 return -1;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
248 ret = mail_storage_mailbox_create(ns->storage, name, directory);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
249 if (ret < 0)
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
250 shared_mailbox_copy_error(storage, ns);
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
251 return ret;
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
252 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
253
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
254 struct mail_storage shared_storage = {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
255 MEMBER(name) SHARED_STORAGE_NAME,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
256 MEMBER(mailbox_is_file) FALSE, /* unknown at this point */
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
257
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
258 {
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
259 NULL,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
260 NULL,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
261 shared_alloc,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
262 shared_create,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
263 index_storage_destroy,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
264 NULL,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
265 shared_mailbox_open,
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
266 shared_mailbox_create
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
267 }
6dd0c6755afe Added initial support for shared mailboxes. Listing isn't supported yet.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
268 };