Browse Source

ignore anything that does not look remotely like a maildir when

collecting mailboxes for OneToOne.
0.9
Oswald Buddenhagen 21 years ago
parent
commit
3de16206e7
  1. 7
      src/main.c

7
src/main.c

@ -25,6 +25,7 @@
#include "isync.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdarg.h>
@ -334,10 +335,16 @@ main (int argc, char **argv)
return 1;
}
while ((de = readdir (dir))) {
struct stat st;
char buf[PATH_MAX];
if (*de->d_name == '.')
continue;
if (global.inbox && !strcmp (global.inbox, de->d_name))
continue;
snprintf (buf, sizeof(buf), "%s/%s/cur", global.maildir, de->d_name);
if (stat (buf, &st) || !S_ISDIR (st.st_mode))
continue;
box = malloc (sizeof (config_t));
memcpy (box, &global, sizeof (config_t));
box->path = strdup (de->d_name);

Loading…
Cancel
Save