From 8eacee21da2b2a78759fc03d90f609c1136d1835 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 25 Nov 2016 15:27:22 +0000 Subject: [PATCH] [Fix] Relax requirements for Received as gmail cannot RFC --- src/ragel/smtp_received.rl | 2 +- utils/received_parser_bench.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/ragel/smtp_received.rl b/src/ragel/smtp_received.rl index c1fd46703..8b88d4ffe 100644 --- a/src/ragel/smtp_received.rl +++ b/src/ragel/smtp_received.rl @@ -42,7 +42,7 @@ no_fold_literal = "[" dtext* "]"; id_right = dot_atom_text | no_fold_literal; msg_id = "<" id_left "@" id_right ">"; - ID = CFWS "ID"i FWS ( Atom | msg_id ); + ID = CFWS "ID"i FWS ( Dot_string | msg_id ); For = CFWS "FOR"i FWS ( Path | Mailbox ) >For_Start %For_End; Additional_Registered_Clauses = CFWS Atom FWS String; diff --git a/utils/received_parser_bench.c b/utils/received_parser_bench.c index cb304b631..41a637422 100644 --- a/utils/received_parser_bench.c +++ b/utils/received_parser_bench.c @@ -26,6 +26,7 @@ static gint total_real_ip = 0; static gint total_real_host = 0; static gint total_known_proto = 0; static gint total_known_ts = 0; +static gint total_known_for = 0; static void rspamd_process_file (const gchar *fname) @@ -82,6 +83,10 @@ rspamd_process_file (const gchar *fname) if (rh.timestamp != 0) { total_known_ts ++; } + + if (rh.for_mbox) { + total_known_for ++; + } } if (err) { @@ -111,11 +116,13 @@ main (int argc, char **argv) "Total real ip: %d\n" "Total real host: %d\n" "Total known proto: %d\n" - "Total known timestamp: %d\n", + "Total known timestamp: %d\n" + "Total known for: %d\n", total_parsed, total_time, total_valid, total_real_ip, total_real_host, total_known_proto, - total_known_ts); + total_known_ts, + total_known_for); return 0; } -- 2.39.5