Mercurial > dovecot > original-hg > dovecot-1.2
comparison src/plugins/convert/convert-tool.c @ 4860:87ae4d41bc10 HEAD
Create storages with MAIL_STORAGE_FLAG_NO_AUTOCREATE flag so we don't keep
recreating the old storage and converting it all the time. Also added
convert_skip_broken_mailboxes flag.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 03 Dec 2006 15:35:18 +0200 |
parents | 5255476a24b5 |
children | 6ab2712f1a93 |
comparison
equal
deleted
inserted
replaced
4859:92c0994a1fcf | 4860:87ae4d41bc10 |
---|---|
4 #include "ioloop.h" | 4 #include "ioloop.h" |
5 #include "randgen.h" | 5 #include "randgen.h" |
6 #include "lib-signals.h" | 6 #include "lib-signals.h" |
7 #include "mail-storage.h" | 7 #include "mail-storage.h" |
8 #include "convert-storage.h" | 8 #include "convert-storage.h" |
9 | |
10 #include <stdlib.h> | |
9 | 11 |
10 int main(int argc, const char *argv[]) | 12 int main(int argc, const char *argv[]) |
11 { | 13 { |
12 struct ioloop *ioloop; | 14 struct ioloop *ioloop; |
13 int ret = 0; | 15 int ret = 0; |
18 mail_storage_init(); | 20 mail_storage_init(); |
19 mail_storage_register_all(); | 21 mail_storage_register_all(); |
20 | 22 |
21 if (argc <= 4) { | 23 if (argc <= 4) { |
22 i_fatal("Usage: <username> <home dir> " | 24 i_fatal("Usage: <username> <home dir> " |
23 "<source mail env> <dest mail env>"); | 25 "<source mail env> <dest mail env> " |
26 "[<1=skip broken mailboxes>]"); | |
24 } | 27 } |
25 | 28 |
26 ioloop = io_loop_create(system_pool); | 29 ioloop = io_loop_create(system_pool); |
27 | 30 |
28 ret = convert_storage(argv[1], argv[2], argv[3], argv[4]); | 31 ret = convert_storage(argv[1], argv[2], argv[3], argv[4], |
32 argv[5] != NULL && atoi(argv[5]) == 1); | |
29 if (ret > 0) | 33 if (ret > 0) |
30 i_info("Successfully converted"); | 34 i_info("Successfully converted"); |
31 else if (ret == 0) | 35 else if (ret == 0) |
32 i_error("Source storage not found"); | 36 i_error("Source storage not found"); |
33 else | 37 else |