From: Timo Sirainen Date: Tue, 29 Jun 2004 15:56:34 +0000 (+0300) Subject: Require that filenames in maildir begin with a digit, otherwise complain. X-Git-Tag: 1.1.alpha1~3850 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a7593b817277baf5b8348ee1839648159d4d09f;p=thirdparty%2Fdovecot%2Fcore.git Require that filenames in maildir begin with a digit, otherwise complain. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/maildir/maildir-sync.c b/src/lib-storage/index/maildir/maildir-sync.c index 5364ab3160..2c9ba50cc5 100644 --- a/src/lib-storage/index/maildir/maildir-sync.c +++ b/src/lib-storage/index/maildir/maildir-sync.c @@ -441,8 +441,13 @@ static int maildir_scan_dir(struct maildir_sync_context *ctx, int new_dir) move_new = new_dir && !mailbox_is_readonly(&ctx->ibox->box) && !ctx->ibox->keep_recent; while ((dp = readdir(dirp)) != NULL) { - if (dp->d_name[0] == '.') + if (dp->d_name[0] < '0' || dp->d_name[0] > '9') { + if (dp->d_name[0] != '.') { + i_warning("Invalid maildir filename in %s: %s", + dir, dp->d_name); + } continue; + } ret = maildir_uidlist_sync_next_pre(ctx->uidlist_sync_ctx, dp->d_name);