diff --git a/src/lib-sieve/sieve-actions.c b/src/lib-sieve/sieve-actions.c index 039c64b4659449cc8e1dd64a49b421dc76be29ce..2ffc967d0439564298b717dfb719f449aa0ebbab 100644 --- a/src/lib-sieve/sieve-actions.c +++ b/src/lib-sieve/sieve-actions.c @@ -218,10 +218,9 @@ static bool act_store_start /* Open the requested mailbox */ if ( aenv->scriptenv->namespaces != NULL ) { ns = mail_namespace_find(aenv->scriptenv->namespaces, &ctx->folder); - if (ns == NULL) - return FALSE; - - box = act_store_mailbox_open(aenv, ns, ctx->folder); + + if ( ns != NULL ) + box = act_store_mailbox_open(aenv, ns, ctx->folder); } /* Create transaction context */ @@ -301,7 +300,10 @@ static void act_store_log_status mailbox_name = str_sanitize(mailbox_get_name(trans->box), 128); if ( trans->namespace == NULL ) { - sieve_result_log(aenv, "store into mailbox '%s' not performed", mailbox_name); + if ( aenv->scriptenv->namespaces == NULL ) + sieve_result_log(aenv, "store into mailbox '%s' skipped", mailbox_name); + else + sieve_result_error(aenv, "failed to find namespace to store into mailbox '%s'", mailbox_name); } else { if ( !rolled_back && status ) { sieve_result_log(aenv, "stored mail into mailbox '%s'", mailbox_name); @@ -374,7 +376,7 @@ static void act_store_rollback if ( trans->mail_trans != NULL ) mailbox_transaction_rollback(&trans->mail_trans); - /* Close the mailbox */ + /* Close the mailbox */ if ( trans->box != NULL ) mailbox_close(&trans->box); } diff --git a/src/lib-sieve/sieve-result.c b/src/lib-sieve/sieve-result.c index 43fd5fd6bc99c60d4d7026d166b6c6bf64164955..db59ec8ec18ce52b4cead44b87106928bc097d4e 100644 --- a/src/lib-sieve/sieve-result.c +++ b/src/lib-sieve/sieve-result.c @@ -541,7 +541,7 @@ static bool _sieve_result_implicit_keep bool dummy = TRUE; struct act_store_context ctx; struct sieve_result_side_effect *rsef, *rsef_first = NULL; - void *tr_context; + void *tr_context = NULL; ctx.folder = result->action_env.scriptenv->default_mailbox;