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

lib-sieve: vnd.dovecot.report extension: Made the report action behave...

lib-sieve: vnd.dovecot.report extension: Made the report action behave correctly when there is no envelope.
parent 6015613a
No related branches found
No related tags found
No related merge requests found
......@@ -462,7 +462,6 @@ static int act_report_send
struct ostream *output;
string_t *msg;
const char *const *headers;
const char *sender, *orig_recipient;
const char *outmsgid, *boundary, *error, *subject;
int ret;
......@@ -473,9 +472,6 @@ static int act_report_send
return SIEVE_EXEC_OK;
}
sender = sieve_message_get_sender(msgctx);
orig_recipient = sieve_message_get_orig_recipient(msgctx);
/* Make sure we have a subject for our report */
if ( mail_get_headers_utf8
(msgdata->mail, "subject", &headers) < 0 ) {
......@@ -551,16 +547,24 @@ static int act_report_send
rfc2822_header_write(msg, "User-Agent",
PACKAGE_NAME "/" PACKAGE_VERSION " "
PIGEONHOLE_NAME "/" PIGEONHOLE_VERSION);
if (sender == NULL) {
rfc2822_header_write(msg,
"Original-Mail-From", "<>");
} else {
rfc2822_header_printf(msg,
"Original-Mail-From", "<%s>", sender);
}
if (orig_recipient != NULL) {
rfc2822_header_printf(msg,
"Original-Rcpt-To", "<%s>", orig_recipient);
if ( (aenv->flags & SIEVE_EXECUTE_FLAG_NO_ENVELOPE) == 0 ) {
const char *sender, *orig_recipient;
sender = sieve_message_get_sender(msgctx);
orig_recipient = sieve_message_get_orig_recipient(msgctx);
if (sender == NULL) {
rfc2822_header_write(msg,
"Original-Mail-From", "<>");
} else {
rfc2822_header_printf(msg,
"Original-Mail-From", "<%s>", sender);
}
if (orig_recipient != NULL) {
rfc2822_header_printf(msg,
"Original-Rcpt-To", "<%s>", orig_recipient);
}
}
str_append(msg, "\r\n");
......
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.