dovecot-2.0-pigeonhole: Sieve tools: started using mail_namespac...
pigeonhole at rename-it.nl
pigeonhole at rename-it.nl
Wed Jun 22 22:09:07 EEST 2011
details: http://hg.rename-it.nl/dovecot-2.0-pigeonhole/rev/b9050c63a238
changeset: 1504:b9050c63a238
user: Stephan Bosch <stephan at rename-it.nl>
date: Wed Jun 22 22:17:28 2011 +0200
description:
Sieve tools: started using mail_namespaces_init_location instead of mail_namespaces_init_empty.
diffstat:
src/lib-sieve-tool/sieve-tool.c | 16 ++++------------
src/sieve-tools/sieve-test.c | 2 +-
src/testsuite/testsuite.c | 6 +-----
3 files changed, 6 insertions(+), 18 deletions(-)
diffs (65 lines):
diff -r 850d5748a115 -r b9050c63a238 src/lib-sieve-tool/sieve-tool.c
--- a/src/lib-sieve-tool/sieve-tool.c Wed Jun 22 19:56:29 2011 +0200
+++ b/src/lib-sieve-tool/sieve-tool.c Wed Jun 22 22:17:28 2011 +0200
@@ -337,10 +337,7 @@
{
struct mail_user *mail_user_dovecot = tool->mail_user_dovecot;
const char *username = tool->username;
- struct mail_namespace_settings ns_set;
struct mail_namespace *ns = NULL;
- enum mail_storage_flags storage_flags =
- MAIL_STORAGE_FLAG_NO_AUTOCREATE;
const char *home = NULL, *errstr = NULL;
tool->mail_user = mail_user_alloc
@@ -353,17 +350,12 @@
if ( mail_user_init(tool->mail_user, &errstr) < 0 )
i_fatal("Test user initialization failed: %s", errstr);
- memset(&ns_set, 0, sizeof(ns_set));
- ns_set.location = mail_location;
- ns_set.inbox = TRUE;
- ns_set.subscriptions = TRUE;
+ if ( mail_namespaces_init_location
+ (tool->mail_user, mail_location, &errstr) < 0 )
+ i_fatal("Test storage creation failed: %s", errstr);
- ns = mail_namespaces_init_empty(tool->mail_user);
+ ns = tool->mail_user->namespaces;
ns->flags |= NAMESPACE_FLAG_NOQUOTA | NAMESPACE_FLAG_NOACL;
- ns->set = &ns_set;
-
- if ( mail_storage_create(ns, NULL, storage_flags, &errstr) < 0 )
- i_fatal("Test storage creation failed: %s", errstr);
}
struct mail *sieve_tool_open_file_as_mail
diff -r 850d5748a115 -r b9050c63a238 src/sieve-tools/sieve-test.c
--- a/src/sieve-tools/sieve-test.c Wed Jun 22 19:56:29 2011 +0200
+++ b/src/sieve-tools/sieve-test.c Wed Jun 22 22:17:28 2011 +0200
@@ -207,7 +207,7 @@
}
/* Finish tool initialization */
- svinst = sieve_tool_init_finish(sieve_tool, TRUE);
+ svinst = sieve_tool_init_finish(sieve_tool, execute && mailloc == NULL);
/* Enable debug extension */
sieve_enable_debug_extension(svinst);
diff -r 850d5748a115 -r b9050c63a238 src/testsuite/testsuite.c
--- a/src/testsuite/testsuite.c Wed Jun 22 19:56:29 2011 +0200
+++ b/src/testsuite/testsuite.c Wed Jun 22 22:17:28 2011 +0200
@@ -136,12 +136,8 @@
/* Initialize mail user */
sieve_tool_set_homedir(sieve_tool, t_abspath(""));
- /* Set dummy mail environment */
- env_put(t_strdup_printf("MAIL=maildir:/tmp/dovecot-test-%s",
- sieve_tool_get_username(sieve_tool)));
-
/* Finish tool initialization */
- svinst = sieve_tool_init_finish(sieve_tool, TRUE);
+ svinst = sieve_tool_init_finish(sieve_tool, FALSE);
testsuite_init(svinst, log_stdout);
testsuite_settings_init();
More information about the dovecot-cvs
mailing list