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

lda-sieve plugin: Added trace logging support.

parent 8b51e7c1
No related branches found
No related tags found
No related merge requests found
......@@ -771,6 +771,8 @@ static int lda_sieve_execute
struct sieve_message_data msgdata;
struct sieve_script_env scriptenv;
struct sieve_exec_status estatus;
struct sieve_trace_config trace_config;
struct sieve_trace_log *trace_log;
bool debug = mdctx->dest_user->mail_debug;
int ret;
......@@ -803,6 +805,14 @@ static int lda_sieve_execute
}
}
/* Initialize trace logging */
if ( sieve_trace_config_get(svinst, &trace_config) >= 0 &&
sieve_trace_log_open(svinst, NULL, &trace_log) < 0 ) {
memset(&trace_config, 0, sizeof(trace_config));
trace_log = NULL;
}
/* Collect necessary message data */
memset(&msgdata, 0, sizeof(msgdata));
......@@ -835,6 +845,8 @@ static int lda_sieve_execute
scriptenv.duplicate_flush = lda_sieve_duplicate_flush;
scriptenv.reject_mail = lda_sieve_reject_mail;
scriptenv.script_context = (void *) mdctx;
scriptenv.trace_log = trace_log;
scriptenv.trace_config = trace_config;
scriptenv.exec_status = &estatus;
srctx->scriptenv = &scriptenv;
......@@ -850,6 +862,9 @@ static int lda_sieve_execute
mdctx->tried_default_save = estatus.tried_default_save;
*storage_r = estatus.last_storage;
if ( trace_log != NULL )
sieve_trace_log_free(&trace_log);
}
return 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.