ensure that mailbox creation in maildir_store() is limited to trashing

other mailboxes would have been maildir_select()ed already.
This commit is contained in:
Oswald Buddenhagen 2012-08-11 17:05:22 +02:00
parent a3f66f8f1d
commit 8121224744

View File

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