21 logmsg(
WHO,111,ERROR,
"MAILDIR not set");
23 logmsg(
WHO,110,FATAL,B(
"unable to chdir to: ",
maildir));
39 while ((
d = readdir(dir))) {
40 if (
d->d_name[0] ==
'.')
continue;
42 if (!stralloc_cats(tmpname,
d->d_name))
break;
43 if (!stralloc_0(tmpname))
break;
44 if (stat(tmpname->s,&st) == 0)
45 if (time > st.st_atime + 129600)
59 dir = opendir(subdir);
61 logmsg(
WHO,112,FATAL,B(
"unable to scan $MAILDIR/:",subdir));
63 while ((
d = readdir(dir))) {
64 if (
d->d_name[0] ==
'.')
continue;
66 if (!stralloc_cats(
filenames,subdir))
break;
68 if (!stralloc_cats(
filenames,
d->d_name))
break;
71 if (st.st_mtime < time) {
74 if (!prioq_insert(
pq,&pe))
break;
79 if (
d) logmsg(
WHO,112,FATAL,B(
"unable to read $MAILDIR/:",subdir));
94 if (flagnew)
if (append(
pq,
filenames,
"new",time) == -1)
return -1;
95 if (flagcur)
if (append(
pq,
filenames,
"cur",time) == -1)
return -1;
int stralloc_copys(stralloc *, char const *)
int maildir_scan(prioq *pq, stralloc *filenames, int flagnew, int flagcur)
void maildir_clean(stralloc *tmpname)