Skip to content
Snippets Groups Projects
Commit 6d707527 authored by Stephan Bosch's avatar Stephan Bosch
Browse files

Merged changes from Pigeonhole v0.3.

parents 079c5271 e6a1b593
No related branches found
No related tags found
No related merge requests found
......@@ -372,27 +372,32 @@ static int lda_sieve_handle_exec_status
struct sieve_instance *svinst = srctx->svinst;
struct sieve_exec_status *estatus = srctx->scriptenv->exec_status;
const char *userlog_notice = "";
sieve_sys_error_func_t error_func = sieve_sys_error;
sieve_sys_error_func_t error_func, user_error_func;
int ret;
error_func = user_error_func = sieve_sys_error;
if ( estatus != NULL && estatus->last_storage != NULL ) {
enum mail_error mail_error;
mail_storage_get_last_error(estatus->last_storage, &mail_error);
/* Don't bother administrator too much with benign errors */
if ( mail_error == MAIL_ERROR_NOSPACE )
if ( mail_error == MAIL_ERROR_NOSPACE ) {
error_func = sieve_sys_info;
user_error_func = sieve_sys_info;
}
}
if ( script == srctx->user_script && srctx->userlog != NULL ) {
userlog_notice = t_strdup_printf
(" (user logfile %s should reveal additional details)", srctx->userlog);
user_error_func = sieve_sys_info;
}
switch ( status ) {
case SIEVE_EXEC_FAILURE:
error_func(svinst,
user_error_func(svinst,
"execution of script %s failed, but implicit keep was successful%s",
sieve_script_location(script), userlog_notice);
ret = 1;
......@@ -496,10 +501,9 @@ static int lda_sieve_multiscript_execute
struct sieve_error_handler *ehandler = srctx->master_ehandler;
bool debug = srctx->mdctx->dest_user->mail_debug;
struct sieve_script *last_script = NULL;
bool user_script = FALSE;
bool user_script = FALSE, more = TRUE, compile_error = FALSE;
unsigned int i;
int ret = 1;
bool more = TRUE;
enum sieve_error error;
/* Start execution */
......@@ -535,8 +539,10 @@ static int lda_sieve_multiscript_execute
sieve_script_location(script));
}
if ( (sbin=lda_sieve_open(srctx, script, cpflags, &error)) == NULL )
if ( (sbin=lda_sieve_open(srctx, script, cpflags, &error)) == NULL ) {
compile_error = TRUE;
break;
}
/* Execute */
......@@ -580,6 +586,13 @@ static int lda_sieve_multiscript_execute
ret = sieve_multiscript_finish(&mscript, ehandler, NULL);
/* Don't log additional messages about compile failure */
if ( compile_error && ret == SIEVE_EXEC_FAILURE ) {
sieve_sys_info(svinst,
"aborted script execution sequence with successful implicit keep");
return 1;
}
return lda_sieve_handle_exec_status(srctx, last_script, ret);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.