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