]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Require that filenames in maildir begin with a digit, otherwise complain.
authorTimo Sirainen <tss@iki.fi>
Tue, 29 Jun 2004 15:56:34 +0000 (18:56 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 29 Jun 2004 15:56:34 +0000 (18:56 +0300)
--HG--
branch : HEAD

src/lib-storage/index/maildir/maildir-sync.c

index 5364ab316011d4c16eae452f91d6420abbfefa9d..2c9ba50cc5bfe299dd62f18736ce26ef57ad9621 100644 (file)
@@ -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);