From a709da98c462abc9f6b08e4288525ad92698685f Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 28 Mar 2018 13:25:34 +0100 Subject: [Feature] Allow to fold headers on stop characters --- src/libutil/str_util.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/libutil/str_util.c') diff --git a/src/libutil/str_util.c b/src/libutil/str_util.c index 7d346354f..238f95c87 100644 --- a/src/libutil/str_util.c +++ b/src/libutil/str_util.c @@ -918,7 +918,8 @@ GString * rspamd_header_value_fold (const gchar *name, const gchar *value, guint fold_max, - enum rspamd_newlines_type how) + enum rspamd_newlines_type how, + const gchar *fold_on_chars) { GString *res; const guint default_fold_max = 76; @@ -1019,6 +1020,13 @@ rspamd_header_value_fold (const gchar *name, cur_len ++; } } + else if (fold_on_chars && strchr (fold_on_chars, *p) != NULL) { + fold_type = fold_after; + state = fold_token; + next_state = read_token; + + p ++; + } else { p ++; cur_len ++; -- cgit v1.2.3