From: Timo Sirainen Date: Fri, 17 Dec 2010 13:16:01 +0000 (+0000) Subject: snarf: Make sure destination mailbox is open when syncing it. X-Git-Tag: 2.0.9~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c14ceb2cabfd4934243d09ff2dfbc24791ef4eb2;p=thirdparty%2Fdovecot%2Fcore.git snarf: Make sure destination mailbox is open when syncing it. --- diff --git a/src/plugins/snarf/snarf-plugin.c b/src/plugins/snarf/snarf-plugin.c index 7d22530541..0210cedcdc 100644 --- a/src/plugins/snarf/snarf-plugin.c +++ b/src/plugins/snarf/snarf-plugin.c @@ -37,6 +37,10 @@ static int snarf(struct mailbox *srcbox, struct mailbox *destbox) enum mail_error error; int ret; + /* make sure the destination mailbox has been opened */ + if (mailbox_open(destbox) < 0) + return -1; + if (mailbox_sync(srcbox, MAILBOX_SYNC_FLAG_FULL_READ) < 0) return -1;