diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-09-22 18:10:43 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-09-22 18:10:43 +0100 |
commit | b0d3ec5f41c220a755e2f394b60481a9a5cb2ff1 (patch) | |
tree | 78cf40dedb8ec330b5b618bc7a05bdbf4723beb1 /src/libserver | |
parent | 261d4e4a379119d40d6cc891548c99b4b517c6d5 (diff) | |
download | rspamd-b0d3ec5f41c220a755e2f394b60481a9a5cb2ff1.tar.gz rspamd-b0d3ec5f41c220a755e2f394b60481a9a5cb2ff1.zip |
[Feature] Try to guess line endings when folding headers
Diffstat (limited to 'src/libserver')
-rw-r--r-- | src/libserver/dkim.c | 3 | ||||
-rw-r--r-- | src/libserver/protocol.c | 2 | ||||
-rw-r--r-- | src/libserver/task.h | 3 |
3 files changed, 5 insertions, 3 deletions
diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c index 33ac2cb96..d545a78e4 100644 --- a/src/libserver/dkim.c +++ b/src/libserver/dkim.c @@ -2162,7 +2162,8 @@ rspamd_dkim_sign (struct rspamd_task *task, return NULL; } - b64_data = rspamd_encode_base64_fold (rsa_buf, rsa_len, 70, NULL); + b64_data = rspamd_encode_base64_fold (rsa_buf, rsa_len, 70, NULL, + task->nlines_type); rspamd_printf_gstring (hdr, "%s", b64_data); g_free (b64_data); diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index 413d48bf2..3ec4c7eca 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -1037,7 +1037,7 @@ rspamd_protocol_write_ucl (struct rspamd_task *task) if (dkim_sig) { GString *folded_header = rspamd_header_value_fold ("DKIM-Signature", - dkim_sig->str, 80); + dkim_sig->str, 80, task->nlines_type); ucl_object_insert_key (top, ucl_object_fromstring_common (folded_header->str, folded_header->len, UCL_STRING_RAW), diff --git a/src/libserver/task.h b/src/libserver/task.h index aa1f52e45..915d58aa3 100644 --- a/src/libserver/task.h +++ b/src/libserver/task.h @@ -114,7 +114,7 @@ enum rspamd_task_stage { #define RSPAMD_TASK_IS_EMPTY(task) (((task)->flags & RSPAMD_TASK_FLAG_EMPTY)) struct rspamd_email_address; - +enum rspamd_newlines_type; /** * Worker task structure @@ -161,6 +161,7 @@ struct rspamd_task { GPtrArray *rcpt_envelope; /**< array of rspamd_email_address */ InternetAddressList *from_mime; struct rspamd_email_address *from_envelope; + enum rspamd_newlines_type nlines_type; /**< type of newlines (detected on most of headers */ GList *messages; /**< list of messages that would be reported */ struct rspamd_re_runtime *re_rt; /**< regexp runtime */ |