|
|
@ -161,15 +161,17 @@ maildir_list( store_t *gctx, string_list_t **retb ) |
|
|
|
} |
|
|
|
} |
|
|
|
*retb = 0; |
|
|
|
*retb = 0; |
|
|
|
while ((de = readdir( dir ))) { |
|
|
|
while ((de = readdir( dir ))) { |
|
|
|
|
|
|
|
const char *inbox = ((maildir_store_conf_t *)gctx->conf)->inbox; |
|
|
|
|
|
|
|
int bl; |
|
|
|
struct stat st; |
|
|
|
struct stat st; |
|
|
|
char buf[PATH_MAX]; |
|
|
|
char buf[PATH_MAX]; |
|
|
|
|
|
|
|
|
|
|
|
if (*de->d_name == '.') |
|
|
|
if (*de->d_name == '.') |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
nfsnprintf( buf, sizeof(buf), "%s%s/cur", gctx->conf->path, de->d_name ); |
|
|
|
bl = nfsnprintf( buf, sizeof(buf), "%s%s/cur", gctx->conf->path, de->d_name ); |
|
|
|
if (stat( buf, &st ) || !S_ISDIR(st.st_mode)) |
|
|
|
if (stat( buf, &st ) || !S_ISDIR(st.st_mode)) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
add_string_list( retb, de->d_name ); |
|
|
|
add_string_list( retb, !memcmp( buf, inbox, bl - 4 ) && !inbox[bl - 4] ? "INBOX" : de->d_name ); |
|
|
|
} |
|
|
|
} |
|
|
|
closedir (dir); |
|
|
|
closedir (dir); |
|
|
|
|
|
|
|
|
|
|
|