diff --git a/src/lib-sieve/cmd-redirect.c b/src/lib-sieve/cmd-redirect.c index 70b177c80da0311fbd1f67add389da745848852f..f9f524ea6cba09a5390850b2fd4629368d118607 100644 --- a/src/lib-sieve/cmd-redirect.c +++ b/src/lib-sieve/cmd-redirect.c @@ -295,11 +295,13 @@ static void act_redirect_print static bool act_redirect_send (const struct sieve_action_exec_env *aenv, struct act_redirect_context *ctx) { - static const char *hide_headers[] = { "Return-Path", "X-Sieve" }; + static const char *hide_headers[] = + { "Return-Path", "X-Sieve", "X-Sieve-Redirected-From" }; const struct sieve_message_data *msgdata = aenv->msgdata; const struct sieve_script_env *senv = aenv->scriptenv; const char *sender = sieve_message_get_sender(aenv->msgctx); + const char *recipient = sieve_message_get_final_recipient(aenv->msgctx); struct istream *input, *crlf_input; void *smtp_handle; FILE *f; @@ -328,8 +330,9 @@ static bool act_redirect_send /* Make sure the message contains CRLF consistently */ crlf_input = i_stream_create_crlf(input); - /* Prepend sieve version header (should not affect signatures) */ + /* Prepend sieve headers (should not affect signatures) */ rfc2822_header_field_write(f, "X-Sieve", SIEVE_IMPLEMENTATION); + rfc2822_header_field_write(f, "X-Sieve-Redirected-From", recipient); /* Pipe the message to the outgoing SMTP transport */ while ((ret = i_stream_read_data(crlf_input, &data, &size, 0)) > 0) {