dovecot-2.0-pigeonhole: Sieve tools: avoid initializing mail sto...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Tue Mar 22 22:20:08 EET 2011


details:   http://hg.rename-it.nl/dovecot-2.0-pigeonhole/rev/ed2d01aff6d0
changeset: 1487:ed2d01aff6d0
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Tue Mar 22 22:25:11 2011 +0100
description:
Sieve tools: avoid initializing mail store (namespaces) for sievec and sieve-dump.

diffstat:

 src/lib-sieve-tool/sieve-tool.c |  6 +++++-
 src/lib-sieve-tool/sieve-tool.h |  3 ++-
 src/sieve-tools/sieve-dump.c    |  2 +-
 src/sieve-tools/sieve-filter.c  |  2 +-
 src/sieve-tools/sieve-test.c    |  2 +-
 src/sieve-tools/sievec.c        |  2 +-
 src/testsuite/testsuite.c       |  2 +-
 7 files changed, 12 insertions(+), 7 deletions(-)

diffs (96 lines):

diff -r b9c507cfa061 -r ed2d01aff6d0 src/lib-sieve-tool/sieve-tool.c
--- a/src/lib-sieve-tool/sieve-tool.c	Tue Mar 22 22:08:55 2011 +0100
+++ b/src/lib-sieve-tool/sieve-tool.c	Tue Mar 22 22:25:11 2011 +0100
@@ -216,7 +216,7 @@
 }
 
 struct sieve_instance *sieve_tool_init_finish
-(struct sieve_tool *tool)
+(struct sieve_tool *tool, bool init_mailstore)
 {
 	enum mail_storage_service_flags storage_service_flags =
 		MAIL_STORAGE_SERVICE_FLAG_NO_CHDIR |
@@ -241,6 +241,10 @@
 		storage_service_flags |=
 			MAIL_STORAGE_SERVICE_FLAG_USERDB_LOOKUP;
 
+	if ( !init_mailstore ) 
+		storage_service_flags |=
+			MAIL_STORAGE_SERVICE_FLAG_NO_NAMESPACES;
+
 	memset(&service_input, 0, sizeof(service_input));
 	service_input.module = "mail";
 	service_input.service = tool->name;
diff -r b9c507cfa061 -r ed2d01aff6d0 src/lib-sieve-tool/sieve-tool.h
--- a/src/lib-sieve-tool/sieve-tool.h	Tue Mar 22 22:08:55 2011 +0100
+++ b/src/lib-sieve-tool/sieve-tool.h	Tue Mar 22 22:25:11 2011 +0100
@@ -29,7 +29,8 @@
 
 int sieve_tool_getopt(struct sieve_tool *tool);
 
-struct sieve_instance *sieve_tool_init_finish(struct sieve_tool *tool);
+struct sieve_instance *sieve_tool_init_finish
+	(struct sieve_tool *tool, bool init_mailstore);
 
 void sieve_tool_deinit(struct sieve_tool **_tool);
 
diff -r b9c507cfa061 -r ed2d01aff6d0 src/sieve-tools/sieve-dump.c
--- a/src/sieve-tools/sieve-dump.c	Tue Mar 22 22:08:55 2011 +0100
+++ b/src/sieve-tools/sieve-dump.c	Tue Mar 22 22:25:11 2011 +0100
@@ -77,7 +77,7 @@
 	} 
 	
 	/* Finish tool initialization */
-	svinst = sieve_tool_init_finish(sieve_tool);
+	svinst = sieve_tool_init_finish(sieve_tool, FALSE);
 
 	/* Register debug extension */
 	(void) sieve_extension_register(svinst, &debug_extension, TRUE);
diff -r b9c507cfa061 -r ed2d01aff6d0 src/sieve-tools/sieve-filter.c
--- a/src/sieve-tools/sieve-filter.c	Tue Mar 22 22:08:55 2011 +0100
+++ b/src/sieve-tools/sieve-filter.c	Tue Mar 22 22:25:11 2011 +0100
@@ -462,7 +462,7 @@
 	}
 
 	/* Finish tool initialization */
-	svinst = sieve_tool_init_finish(sieve_tool);
+	svinst = sieve_tool_init_finish(sieve_tool, TRUE);
 
 	/* Register Sieve debug extension */
 	(void) sieve_extension_register(svinst, &debug_extension, TRUE);
diff -r b9c507cfa061 -r ed2d01aff6d0 src/sieve-tools/sieve-test.c
--- a/src/sieve-tools/sieve-test.c	Tue Mar 22 22:08:55 2011 +0100
+++ b/src/sieve-tools/sieve-test.c	Tue Mar 22 22:25:11 2011 +0100
@@ -209,7 +209,7 @@
 	}
 
 	/* Finish tool initialization */
-	svinst = sieve_tool_init_finish(sieve_tool);
+	svinst = sieve_tool_init_finish(sieve_tool, TRUE);
 
 	/* Register debug extension */
 	(void) sieve_extension_register(svinst, &debug_extension, TRUE);
diff -r b9c507cfa061 -r ed2d01aff6d0 src/sieve-tools/sievec.c
--- a/src/sieve-tools/sievec.c	Tue Mar 22 22:08:55 2011 +0100
+++ b/src/sieve-tools/sievec.c	Tue Mar 22 22:25:11 2011 +0100
@@ -80,7 +80,7 @@
 		outfile = "-";
 	}
 
-	svinst = sieve_tool_init_finish(sieve_tool);
+	svinst = sieve_tool_init_finish(sieve_tool, FALSE);
 
 	/* Register debug extension */
 	(void) sieve_extension_register(svinst, &debug_extension, TRUE);
diff -r b9c507cfa061 -r ed2d01aff6d0 src/testsuite/testsuite.c
--- a/src/testsuite/testsuite.c	Tue Mar 22 22:08:55 2011 +0100
+++ b/src/testsuite/testsuite.c	Tue Mar 22 22:25:11 2011 +0100
@@ -141,7 +141,7 @@
 		sieve_tool_get_username(sieve_tool)));
 
 	/* Finish tool initialization */
-	svinst = sieve_tool_init_finish(sieve_tool);
+	svinst = sieve_tool_init_finish(sieve_tool, TRUE);
 		
 	testsuite_init(svinst, log_stdout);
 	testsuite_settings_init();


More information about the dovecot-cvs mailing list