From 6faf91a8068a14ce0fd5ac9695b567a569cad2c1 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Thu, 9 Nov 2023 12:26:33 -0800 Subject: [PATCH] add an ignore filter based on substring of the file --- src/drv_maildir.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/drv_maildir.c b/src/drv_maildir.c index f916632..6080877 100644 --- a/src/drv_maildir.c +++ b/src/drv_maildir.c @@ -991,9 +991,12 @@ maildir_scan( maildir_store_t *ctx, msg_t_array_alloc_t *msglist ) #endif /* USE_DB */ return DRV_BOX_BAD; } + const char *filter = getenv("MBSYNC_MAILDIR_IGNORE"); while ((e = readdir( d ))) { if (*e->d_name == '.') continue; + if (filter && strstr(e->d_name, filter)) + continue; ctx->total_msgs++; ctx->recent_msgs += i; #ifdef USE_DB