Watch utility for local maildir.
git clone git://git.skec.site/pub/mailstatus.git
log | files | refs | readme | license

commit db5fdecd77253a9d745413975c672793bc89e49a
parent 1680ee952c1c2a4082ec77dcf5298d7b7ccf86b3
Author: Michael Skec
Date:   Thu, 16 Nov 2023 10:17:53 +1100

Listen for IN_MOVE events

mbsync seems to "move" files to the 'new' directory.

Diffstat:
Mmailstatus.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mailstatus.c b/mailstatus.c @@ -113,7 +113,7 @@ main(int argc, char **argv) /* Register inotify watch on the mail directory */ _watch = inotify_add_watch(_inotify, _maildir_inbox_new, - IN_CREATE | IN_DELETE); + IN_CREATE | IN_DELETE | IN_MOVE); if (_watch == -1) { fprintf(stderr, "failed to add inotify watch (%d): %s\n", @@ -155,7 +155,7 @@ main(int argc, char **argv) { e = (const struct inotify_event *)p; - if (e->mask & (IN_CREATE | IN_DELETE)) + if (e->mask & (IN_CREATE | IN_DELETE | IN_MOVE)) ++count; }