4 * Copyright (C) 2009-2015 Ali Gholami Rudi <ali at rudi dot ir>
6 * This program is released under the Modified BSD license.
18 static int has_mail(char *path
)
21 if (stat(path
, &st
) == -1)
23 return st
.st_mtime
> st
.st_atime
;
26 static int ns(char *argv
[])
29 for (i
= 0; argv
[i
]; i
++)
30 if (has_mail(argv
[i
]))
31 printf("%s\n", argv
[i
]);
36 "usage: neatmail command [options]\n\n"
38 " ex \texecute commands on an mbox\n"
39 " mk \tlist the messages in an mbox\n"
40 " pg \tpage a message of an mbox\n"
41 " ns \tcheck mboxes for new mails\n";
43 int main(int argc
, char *argv
[])
45 signal(SIGPIPE
, SIG_IGN
);
48 if (argv
[1] && !strcmp("mk", argv
[1]))
50 if (argv
[1] && !strcmp("ex", argv
[1]))
52 if (argv
[1] && !strcmp("pg", argv
[1]))
54 if (argv
[1] && !strcmp("ns", argv
[1]))