From 812122474435d4cf82908855143202b08b05d752 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sat, 11 Aug 2012 17:05:22 +0200 Subject: [PATCH] ensure that mailbox creation in maildir_store() is limited to trashing other mailboxes would have been maildir_select()ed already. --- src/drv_maildir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drv_maildir.c b/src/drv_maildir.c index b68d9ce..401c27f 100644 --- a/src/drv_maildir.c +++ b/src/drv_maildir.c @@ -1101,7 +1101,7 @@ maildir_store_msg( store_t *gctx, msg_data_t *data, int to_trash, maildir_make_flags( data->flags, fbuf ); nfsnprintf( buf, sizeof(buf), "%s%s/tmp/%s%s", prefix, box, base, fbuf ); if ((fd = open( buf, O_WRONLY|O_CREAT|O_EXCL, 0600 )) < 0) { - if (errno != ENOENT) { + if (errno != ENOENT || !to_trash) { sys_error( "Maildir error: cannot create %s", buf ); free( data->data ); cb( DRV_BOX_BAD, 0, aux );