add an ignore filter based on substring of the file

This commit is contained in:
Emil Lerch 2023-11-09 12:26:33 -08:00
parent bb5e98e9ec
commit 6faf91a806
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -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