aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime/message.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2017-06-21 18:59:02 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2017-06-21 19:06:30 +0100
commitd7fd796275d2edd16da117521b4eef29bea21864 (patch)
treef7237b2b84be6430aab08791ae87a71c8654022a /src/libmime/message.c
parent3f772ca4933e97aa15c15f8dc2a487c550a0a32d (diff)
downloadrspamd-d7fd796275d2edd16da117521b4eef29bea21864.tar.gz
rspamd-d7fd796275d2edd16da117521b4eef29bea21864.zip
[Minor] Add some more data to the spaces strip algorithm
Diffstat (limited to 'src/libmime/message.c')
-rw-r--r--src/libmime/message.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c
index e328585cf..0d495fcd8 100644
--- a/src/libmime/message.c
+++ b/src/libmime/message.c
@@ -374,6 +374,7 @@ rspamd_strip_newlines_parse (const gchar *begin, const gchar *pe,
}
part->nlines ++;
+ part->empty_lines ++;
c = p + 1;
break;
case seen_lf:
@@ -436,6 +437,7 @@ rspamd_strip_newlines_parse (const gchar *begin, const gchar *pe,
}
part->nlines++;
+ part->empty_lines ++;
c = p + 1;
break;
@@ -459,6 +461,9 @@ rspamd_strip_newlines_parse (const gchar *begin, const gchar *pe,
if (G_UNLIKELY (*p & 0x80)) {
part->non_aciii_chars ++;
}
+ else {
+ part->ascii_chars ++;
+ }
}
break;
case seen_cr:
@@ -477,6 +482,10 @@ rspamd_strip_newlines_parse (const gchar *begin, const gchar *pe,
c ++;
part->spaces ++;
}
+
+ if (*p == '\r' || *p == '\n') {
+ part->empty_lines ++;
+ }
}
state = normal_char;
@@ -508,6 +517,9 @@ rspamd_strip_newlines_parse (const gchar *begin, const gchar *pe,
if (G_UNLIKELY (*p & 0x80)) {
part->non_aciii_chars ++;
}
+ else {
+ part->ascii_chars ++;
+ }
}
c ++;