[dovecot-cvs] dovecot/src/plugins/convert convert-storage.c, 1.5,
1.5.2.1
cras at dovecot.org
cras at dovecot.org
Thu Jun 8 19:15:52 EEST 2006
Update of /var/lib/cvs/dovecot/src/plugins/convert
In directory talvi:/tmp/cvs-serv10807
Modified Files:
Tag: branch_1_0
convert-storage.c
Log Message:
Create destination INBOX always uppercased.
Index: convert-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/convert/convert-storage.c,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -d -r1.5 -r1.5.2.1
--- convert-storage.c 22 Feb 2006 14:52:19 -0000 1.5
+++ convert-storage.c 8 Jun 2006 16:15:50 -0000 1.5.2.1
@@ -103,43 +103,43 @@
struct mailbox_list *list,
struct dotlock *dotlock)
{
+ const char *name;
struct mailbox *srcbox, *destbox;
int ret = 0;
if ((list->flags & (MAILBOX_NONEXISTENT|MAILBOX_PLACEHOLDER)) != 0)
return 0;
+ name = strcasecmp(list->name, "INBOX") == 0 ? "INBOX" : list->name;
if ((list->flags & MAILBOX_NOSELECT) != 0) {
- if (mail_storage_mailbox_create(dest_storage,
- list->name, TRUE) < 0) {
+ if (mail_storage_mailbox_create(dest_storage, name, TRUE) < 0) {
i_error("Mailbox conversion: Couldn't create mailbox "
- "directory %s", list->name);
+ "directory %s", name);
return -1;
}
return 0;
}
/* It's a real mailbox. First create the destination mailbox. */
- if (mail_storage_mailbox_create(dest_storage, list->name, FALSE) < 0) {
- i_error("Mailbox conversion: Couldn't create mailbox %s",
- list->name);
+ if (mail_storage_mailbox_create(dest_storage, name, FALSE) < 0) {
+ i_error("Mailbox conversion: Couldn't create mailbox %s", name);
return -1;
}
/* Open both the mailboxes.. */
- srcbox = mailbox_open(source_storage, list->name, NULL,
+ srcbox = mailbox_open(source_storage, name, NULL,
MAILBOX_OPEN_READONLY | MAILBOX_OPEN_KEEP_RECENT);
if (srcbox == NULL) {
i_error("Mailbox conversion: Couldn't open source mailbox %s",
- list->name);
+ name);
return -1;
}
- destbox = mailbox_open(dest_storage, list->name, NULL,
+ destbox = mailbox_open(dest_storage, name, NULL,
MAILBOX_OPEN_KEEP_RECENT);
if (destbox == NULL) {
i_error("Mailbox conversion: Couldn't open dest mailbox %s",
- list->name);
+ name);
mailbox_close(&srcbox);
return -1;
}
More information about the dovecot-cvs
mailing list