dovecot-2.0-pigeonhole: Adjusted to Dovecot LDA API changes; imp...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Fri Jul 16 22:31:54 EEST 2010


details:   http://hg.rename-it.nl/dovecot-2.0-pigeonhole/rev/50dc4c2ae28f
changeset: 1335:50dc4c2ae28f
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Fri Jul 16 21:31:46 2010 +0200
description:
Adjusted to Dovecot LDA API changes; implicitly fixing segfault (patch by Timo Sirainen).

diffstat:

 src/lib-sieve/sieve-actions.c |  14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diffs (62 lines):

diff -r 70b5312e9dc5 -r 50dc4c2ae28f src/lib-sieve/sieve-actions.c
--- a/src/lib-sieve/sieve-actions.c	Fri Jul 16 21:11:25 2010 +0200
+++ b/src/lib-sieve/sieve-actions.c	Fri Jul 16 21:31:46 2010 +0200
@@ -332,17 +332,17 @@
 
 static bool act_store_mailbox_open
 (const struct sieve_action_exec_env *aenv, const char *mailbox,
-	struct mailbox **box_r, const char **error_r)
+	struct mailbox **box_r, enum mail_error *error_code_r, const char **error_r)
 {
 	struct mail_storage **storage = &(aenv->exec_status->last_storage);
 	struct mail_deliver_save_open_context save_ctx;
-	const char *error;
 
 	*box_r = NULL;
 
 	if ( !uni_utf8_str_is_valid(mailbox) ) {
 		/* FIXME: check utf-8 validity at compiletime/runtime */
 		*error_r = t_strdup_printf("mailbox name not utf-8: %s", mailbox);
+		*error_code_r = MAIL_ERROR_PARAMS;
 		return FALSE;
 	}
 
@@ -351,10 +351,8 @@
 	save_ctx.lda_mailbox_autocreate = aenv->scriptenv->mailbox_autocreate;
 	save_ctx.lda_mailbox_autosubscribe = aenv->scriptenv->mailbox_autosubscribe;
 
-	if (mail_deliver_save_open(&save_ctx, mailbox, box_r, &error) < 0) {
-		*error_r = error;
+	if (mail_deliver_save_open(&save_ctx, mailbox, box_r, error_code_r, error_r) < 0)
 		return FALSE;
-	}
 
 	*storage = mailbox_get_storage(*box_r);
 	return TRUE;
@@ -370,6 +368,7 @@
 	struct mailbox *box = NULL;
 	pool_t pool = sieve_result_pool(aenv->result);
 	const char *error = NULL;
+	enum mail_error error_code = MAIL_ERROR_NONE;
 	bool disabled = FALSE, open_failed = FALSE;
 
 	/* If context is NULL, the store action is the result of (implicit) keep */	
@@ -384,7 +383,7 @@
 	 * to NULL. This implementation will then skip actually storing the message.
 	 */
 	if ( senv->user != NULL ) {
-		if ( !act_store_mailbox_open(aenv, ctx->mailbox, &box, &error) ) {
+		if ( !act_store_mailbox_open(aenv, ctx->mailbox, &box, &error_code, &error) ) {
 			open_failed = TRUE;
 		}
 	} else {
@@ -402,8 +401,7 @@
 
 	if ( open_failed  ) {
 		trans->error = error;
-		(void)mail_storage_get_last_error
-			(mailbox_get_storage(trans->box), &trans->error_code);
+		trans->error_code = error_code;
 	} else {
 		trans->error_code = MAIL_ERROR_NONE;
 	}


More information about the dovecot-cvs mailing list