aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-07-03 13:00:42 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-07-03 13:00:42 +0100
commit28005bfdd441e313132b31f64497a86d0e27da62 (patch)
treee79c8f810b6b0cb8b86ecbf4f9e18ce4d754ee5a
parentbf974d701dc8a385e9a3e24909899088736429f6 (diff)
downloadrspamd-28005bfdd441e313132b31f64497a86d0e27da62.tar.gz
rspamd-28005bfdd441e313132b31f64497a86d0e27da62.zip
[Feature] Add more non-conformant Received headers support
Received: from xx (1.1.2.2) by YYY.COM (xx:xx:xx:xx) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 1.2.5.1; Wed, 7 Mar 2018 23:13:02 +0000
-rw-r--r--src/ragel/smtp_address.rl1
-rw-r--r--src/ragel/smtp_received.rl3
2 files changed, 3 insertions, 1 deletions
diff --git a/src/ragel/smtp_address.rl b/src/ragel/smtp_address.rl
index 4ea64eddf..f5d04f620 100644
--- a/src/ragel/smtp_address.rl
+++ b/src/ragel/smtp_address.rl
@@ -14,6 +14,7 @@
address_literal = "[" ( IPv4_address_literal |
IPv6_address_literal |
General_address_literal ) >Domain_addr_start %Domain_addr_end "]";
+ non_conformant_address_literal = IPv4_address_literal >Domain_addr_start %Domain_addr_end;
sub_domain = Let_dig Ldh_str?;
diff --git a/src/ragel/smtp_received.rl b/src/ragel/smtp_received.rl
index 12aaeb08c..b13259fed 100644
--- a/src/ragel/smtp_received.rl
+++ b/src/ragel/smtp_received.rl
@@ -17,7 +17,8 @@
Attdl_Protocol;
TCP_info = address_literal >Real_IP_Start %Real_IP_End |
- ( Domain >Real_Domain_Start %Real_Domain_End FWS address_literal >Real_IP_Start %Real_IP_End );
+ ( Domain >Real_Domain_Start %Real_Domain_End FWS address_literal >Real_IP_Start %Real_IP_End ) |
+ ( non_conformant_address_literal >Real_IP_Start %Real_IP_End );
Extended_Domain = Domain >Real_Domain_Start %Real_Domain_End | # Used to be a real domain
( Domain >Reported_Domain_Start %Reported_Domain_End FWS "(" TCP_info ")" ) | # Here domain is something specified by remote side
( address_literal >Real_Domain_Start %Real_Domain_End FWS "(" TCP_info ")" ) |