[dovecot-cvs] dovecot/src/plugins/convert convert-storage.c, 1.18, 1.19
tss at dovecot.org
tss at dovecot.org
Sat Apr 7 11:07:54 EEST 2007
Update of /var/lib/cvs/dovecot/src/plugins/convert
In directory talvi:/tmp/cvs-serv17744
Modified Files:
convert-storage.c
Log Message:
If directory for destination storage doesn't exist, create it.
Index: convert-storage.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/convert/convert-storage.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- convert-storage.c 7 Apr 2007 08:04:55 -0000 1.18
+++ convert-storage.c 7 Apr 2007 08:07:52 -0000 1.19
@@ -253,16 +253,19 @@
{
struct mail_namespace *source_ns, *dest_ns;
struct dotlock *dotlock;
- enum mail_storage_flags flags;
+ enum mail_storage_flags src_flags, dest_flags;
enum file_lock_method lock_method;
const char *path;
int ret;
source_ns = mail_namespaces_init_empty(pool_datastack_create());
- mail_storage_parse_env(&flags, &lock_method);
- flags |= MAIL_STORAGE_FLAG_NO_AUTOCREATE | MAIL_STORAGE_FLAG_HAS_INBOX;
+ mail_storage_parse_env(&src_flags, &lock_method);
+ src_flags |= MAIL_STORAGE_FLAG_HAS_INBOX;
+ dest_flags = src_flags;
+
+ src_flags |= MAIL_STORAGE_FLAG_NO_AUTOCREATE;
if (mail_storage_create(source_ns, NULL, source_data, user,
- flags, lock_method) < 0) {
+ src_flags, lock_method) < 0) {
/* No need for conversion. */
return 0;
}
@@ -282,7 +285,7 @@
reopen the source storage */
mail_storage_destroy(&source_ns->storage);
if (mail_storage_create(source_ns, NULL, source_data, user,
- flags, lock_method) < 0) {
+ src_flags, lock_method) < 0) {
/* No need for conversion anymore. */
file_dotlock_delete(&dotlock);
return 0;
@@ -290,7 +293,7 @@
dest_ns = mail_namespaces_init_empty(pool_datastack_create());
if (mail_storage_create(dest_ns, NULL, dest_data, user,
- flags, lock_method) < 0) {
+ dest_flags, lock_method) < 0) {
i_error("Mailbox conversion: Failed to create destination "
"storage with data: %s", dest_data);
ret = -1;
More information about the dovecot-cvs
mailing list