(namespace_getfullpath): Translate INBOX to the corresponding filename.
Showing
1 changed file
with
20 additions
and
1 deletions
... | @@ -199,7 +199,26 @@ namespace_checkfullpath (char *name, const char *pattern, const char *delim) | ... | @@ -199,7 +199,26 @@ namespace_checkfullpath (char *name, const char *pattern, const char *delim) |
199 | char * | 199 | char * |
200 | namespace_getfullpath (char *name, const char *delim) | 200 | namespace_getfullpath (char *name, const char *delim) |
201 | { | 201 | { |
202 | return namespace_checkfullpath (name, NULL, delim); | 202 | if (strcasecmp (name, "INBOX") == 0 && !mu_virtual_domain) |
203 | { | ||
204 | struct passwd *pw = mu_getpwuid (getuid ()); | ||
205 | if (pw) | ||
206 | { | ||
207 | name = malloc (strlen (mu_path_maildir) + | ||
208 | strlen (pw->pw_name) + 1); | ||
209 | if (!name) | ||
210 | { | ||
211 | syslog (LOG_ERR, "Not enough memory"); | ||
212 | return NULL; | ||
213 | } | ||
214 | sprintf (name, "%s%s", mu_path_maildir, pw->pw_name); | ||
215 | } | ||
216 | else | ||
217 | name = strdup ("/dev/null"); | ||
218 | } | ||
219 | else | ||
220 | name = namespace_checkfullpath (name, NULL, delim); | ||
221 | return name; | ||
203 | } | 222 | } |
204 | 223 | ||
205 | 224 | ... | ... |
-
Please register or sign in to post a comment