Mercurial > dovecot > original-hg > dovecot-1.2
annotate src/lib-storage/mail-storage.c @ 1138:340dea0150bf HEAD
Added client_workarounds setting, with currently one workaround for OE6.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 11 Feb 2003 12:30:29 +0200 |
parents | fd8888f6f037 |
children | 058f6c26f405 |
rev | line source |
---|---|
0 | 1 /* Copyright (C) 2002 Timo Sirainen */ |
2 | |
3 #include "lib.h" | |
13
bb294faf7379
"Critical errors" aren't displayed to users anymore, ie. anything that is
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
4 #include "ioloop.h" |
0 | 5 #include "mail-storage.h" |
6 | |
1138
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
7 #include <stdlib.h> |
13
bb294faf7379
"Critical errors" aren't displayed to users anymore, ie. anything that is
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
8 #include <time.h> |
0 | 9 #include <ctype.h> |
10 | |
13
bb294faf7379
"Critical errors" aren't displayed to users anymore, ie. anything that is
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
11 /* Message to show to users when critical error occurs */ |
bb294faf7379
"Critical errors" aren't displayed to users anymore, ie. anything that is
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
12 #define CRITICAL_MSG "Internal error [%Y-%m-%d %H:%M:%S]" |
bb294faf7379
"Critical errors" aren't displayed to users anymore, ie. anything that is
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
13 |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
14 struct mail_storage_list { |
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
15 struct mail_storage_list *next; |
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
16 struct mail_storage *storage; |
0 | 17 }; |
18 | |
1138
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
19 struct client_workaround_list { |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
20 const char *name; |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
21 enum client_workarounds num; |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
22 }; |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
23 |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
24 struct client_workaround_list client_workaround_list[] = { |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
25 { "oe6-fetch-no-newmail", WORKAROUND_OE6_FETCH_NO_NEWMAIL }, |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
26 { NULL, 0 } |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
27 }; |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
28 |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
29 static struct mail_storage_list *storages = NULL; |
1138
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
30 enum client_workarounds client_workarounds = 0; |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
31 |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
32 void mail_storage_init(void) |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
33 { |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
34 struct client_workaround_list *list; |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
35 const char *env; |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
36 const char *const *str; |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
37 |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
38 env = getenv("CLIENT_WORKAROUNDS"); |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
39 if (env == NULL) |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
40 return; |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
41 |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
42 for (str = t_strsplit(env, " "); *str != NULL; str++) { |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
43 list = client_workaround_list; |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
44 for (; list->name != NULL; list++) { |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
45 if (strcasecmp(*str, list->name) == 0) |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
46 client_workarounds |= list->num; |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
47 else |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
48 i_fatal("Unknown client workaround: %s", *str); |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
49 } |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
50 } |
340dea0150bf
Added client_workarounds setting, with currently one workaround for OE6.
Timo Sirainen <tss@iki.fi>
parents:
903
diff
changeset
|
51 } |
0 | 52 |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
53 void mail_storage_class_register(struct mail_storage *storage_class) |
0 | 54 { |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
55 struct mail_storage_list *list, **pos; |
0 | 56 |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
57 list = i_new(struct mail_storage_list, 1); |
0 | 58 list->storage = storage_class; |
59 | |
60 /* append it after the list, so the autodetection order is correct */ | |
61 pos = &storages; | |
62 while (*pos != NULL) | |
63 pos = &(*pos)->next; | |
64 *pos = list; | |
65 } | |
66 | |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
67 void mail_storage_class_unregister(struct mail_storage *storage_class) |
0 | 68 { |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
69 struct mail_storage_list **list, *next; |
0 | 70 |
71 for (list = &storages; *list != NULL; list = &(*list)->next) { | |
72 if ((*list)->storage == storage_class) { | |
73 next = (*list)->next; | |
74 | |
75 (*list)->storage->free((*list)->storage); | |
76 i_free(*list); | |
77 | |
78 *list = next; | |
79 } | |
80 } | |
81 } | |
82 | |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
83 struct mail_storage *mail_storage_create(const char *name, const char *data, |
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
84 const char *user) |
0 | 85 { |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
86 struct mail_storage_list *list; |
0 | 87 |
88 i_assert(name != NULL); | |
89 | |
90 for (list = storages; list != NULL; list = list->next) { | |
91 if (strcasecmp(list->storage->name, name) == 0) | |
22
a946ce1f09b7
mbox fixes, not fully working yet but almost :)
Timo Sirainen <tss@iki.fi>
parents:
13
diff
changeset
|
92 return list->storage->create(data, user); |
0 | 93 } |
94 | |
95 return NULL; | |
96 } | |
97 | |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
98 struct mail_storage *mail_storage_create_default(const char *user) |
0 | 99 { |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
100 struct mail_storage_list *list; |
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
101 struct mail_storage *storage; |
0 | 102 |
103 for (list = storages; list != NULL; list = list->next) { | |
22
a946ce1f09b7
mbox fixes, not fully working yet but almost :)
Timo Sirainen <tss@iki.fi>
parents:
13
diff
changeset
|
104 storage = list->storage->create(NULL, user); |
0 | 105 if (storage != NULL) |
106 return storage; | |
107 } | |
108 | |
109 return NULL; | |
110 } | |
111 | |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
112 static struct mail_storage *mail_storage_autodetect(const char *data) |
0 | 113 { |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
114 struct mail_storage_list *list; |
0 | 115 |
116 for (list = storages; list != NULL; list = list->next) { | |
117 if (list->storage->autodetect(data)) | |
118 return list->storage; | |
119 } | |
120 | |
121 return NULL; | |
122 } | |
123 | |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
124 struct mail_storage *mail_storage_create_with_data(const char *data, |
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
125 const char *user) |
0 | 126 { |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
127 struct mail_storage *storage; |
0 | 128 const char *p, *name; |
129 | |
130 if (data == NULL || *data == '\0') | |
22
a946ce1f09b7
mbox fixes, not fully working yet but almost :)
Timo Sirainen <tss@iki.fi>
parents:
13
diff
changeset
|
131 return mail_storage_create_default(user); |
0 | 132 |
133 /* check if we're in the form of mailformat:data | |
134 (eg. maildir:Maildir) */ | |
135 p = data; | |
136 while (i_isalnum(*p)) p++; | |
137 | |
138 if (*p == ':') { | |
5
1b34ec11fff8
Message data is parsed in blocks (no longer entirely mmap()ed). Several
Timo Sirainen <tss@iki.fi>
parents:
0
diff
changeset
|
139 name = t_strdup_until(data, p); |
22
a946ce1f09b7
mbox fixes, not fully working yet but almost :)
Timo Sirainen <tss@iki.fi>
parents:
13
diff
changeset
|
140 storage = mail_storage_create(name, p+1, user); |
0 | 141 } else { |
142 storage = mail_storage_autodetect(data); | |
143 if (storage != NULL) | |
22
a946ce1f09b7
mbox fixes, not fully working yet but almost :)
Timo Sirainen <tss@iki.fi>
parents:
13
diff
changeset
|
144 storage = storage->create(data, user); |
0 | 145 } |
146 | |
147 return storage; | |
148 } | |
149 | |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
150 void mail_storage_destroy(struct mail_storage *storage) |
0 | 151 { |
152 i_assert(storage != NULL); | |
153 | |
154 i_free(storage->dir); | |
155 i_free(storage); | |
156 } | |
157 | |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
158 void mail_storage_clear_error(struct mail_storage *storage) |
0 | 159 { |
160 i_free(storage->error); | |
161 storage->error = NULL; | |
883
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
162 |
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
163 storage->syntax_error = FALSE; |
0 | 164 } |
165 | |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
166 void mail_storage_set_error(struct mail_storage *storage, const char *fmt, ...) |
0 | 167 { |
168 va_list va; | |
169 | |
170 i_free(storage->error); | |
171 | |
172 if (fmt == NULL) | |
173 storage->error = NULL; | |
174 else { | |
175 va_start(va, fmt); | |
176 storage->error = i_strdup_vprintf(fmt, va); | |
883
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
177 storage->syntax_error = FALSE; |
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
178 va_end(va); |
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
179 } |
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
180 } |
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
181 |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
182 void mail_storage_set_syntax_error(struct mail_storage *storage, |
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
183 const char *fmt, ...) |
883
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
184 { |
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
185 va_list va; |
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
186 |
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
187 i_free(storage->error); |
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
188 |
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
189 if (fmt == NULL) |
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
190 storage->error = NULL; |
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
191 else { |
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
192 va_start(va, fmt); |
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
193 storage->error = i_strdup_vprintf(fmt, va); |
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
194 storage->syntax_error = TRUE; |
0 | 195 va_end(va); |
196 } | |
197 } | |
198 | |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
199 void mail_storage_set_internal_error(struct mail_storage *storage) |
13
bb294faf7379
"Critical errors" aren't displayed to users anymore, ie. anything that is
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
200 { |
bb294faf7379
"Critical errors" aren't displayed to users anymore, ie. anything that is
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
201 struct tm *tm; |
765
553f050c8313
Added buffer API. Point is to hide all buffer writing behind this API which
Timo Sirainen <tss@iki.fi>
parents:
22
diff
changeset
|
202 char str[256]; |
13
bb294faf7379
"Critical errors" aren't displayed to users anymore, ie. anything that is
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
203 |
bb294faf7379
"Critical errors" aren't displayed to users anymore, ie. anything that is
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
204 tm = localtime(&ioloop_time); |
bb294faf7379
"Critical errors" aren't displayed to users anymore, ie. anything that is
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
205 |
765
553f050c8313
Added buffer API. Point is to hide all buffer writing behind this API which
Timo Sirainen <tss@iki.fi>
parents:
22
diff
changeset
|
206 storage->error = strftime(str, sizeof(str), CRITICAL_MSG, tm) > 0 ? |
13
bb294faf7379
"Critical errors" aren't displayed to users anymore, ie. anything that is
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
207 i_strdup(str) : i_strdup("Internal error"); |
883
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
208 storage->syntax_error = FALSE; |
13
bb294faf7379
"Critical errors" aren't displayed to users anymore, ie. anything that is
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
209 } |
bb294faf7379
"Critical errors" aren't displayed to users anymore, ie. anything that is
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
210 |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
211 void mail_storage_set_critical(struct mail_storage *storage, |
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
212 const char *fmt, ...) |
0 | 213 { |
214 va_list va; | |
215 | |
216 i_free(storage->error); | |
217 if (fmt == NULL) | |
218 storage->error = NULL; | |
219 else { | |
220 va_start(va, fmt); | |
13
bb294faf7379
"Critical errors" aren't displayed to users anymore, ie. anything that is
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
221 i_error("%s", t_strdup_vprintf(fmt, va)); |
0 | 222 va_end(va); |
223 | |
13
bb294faf7379
"Critical errors" aren't displayed to users anymore, ie. anything that is
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
224 /* critical errors may contain sensitive data, so let user |
bb294faf7379
"Critical errors" aren't displayed to users anymore, ie. anything that is
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
225 see only "Internal error" with a timestamp to make it |
bb294faf7379
"Critical errors" aren't displayed to users anymore, ie. anything that is
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
226 easier to look from log files the actual error message. */ |
bb294faf7379
"Critical errors" aren't displayed to users anymore, ie. anything that is
Timo Sirainen <tss@iki.fi>
parents:
5
diff
changeset
|
227 mail_storage_set_internal_error(storage); |
0 | 228 } |
229 } | |
230 | |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
231 const char *mail_storage_get_last_error(struct mail_storage *storage, |
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
232 int *syntax) |
0 | 233 { |
883
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
234 if (syntax != NULL) |
39e0b536e708
Storage can now specify if errors should be sent to user as BAD or NO.
Timo Sirainen <tss@iki.fi>
parents:
765
diff
changeset
|
235 *syntax = storage->syntax_error; |
0 | 236 return storage->error; |
237 } | |
238 | |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
883
diff
changeset
|
239 int mail_storage_is_inconsistency_error(struct mailbox *box) |
0 | 240 { |
241 return box->inconsistent; | |
242 } |