diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-06-15 17:42:56 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-06-15 17:42:56 +0100 |
commit | 4cd5cfe03ca6b315ea35a89df9f32b12d37fe694 (patch) | |
tree | cabb7542f9618a83ca58fee755b6ee5e4f4f84b3 | |
parent | f166c85751692f0a317b0eb129e6ed0557e281a4 (diff) | |
download | rspamd-4cd5cfe03ca6b315ea35a89df9f32b12d37fe694.tar.gz rspamd-4cd5cfe03ca6b315ea35a89df9f32b12d37fe694.zip |
[Feature] Add ESMTPSA received type
-rw-r--r-- | src/libmime/message.h | 1 | ||||
-rw-r--r-- | src/lua/lua_task.c | 5 | ||||
-rw-r--r-- | src/ragel/smtp_received.rl | 1 | ||||
-rw-r--r-- | src/ragel/smtp_received_parser.rl | 3 |
4 files changed, 9 insertions, 1 deletions
diff --git a/src/libmime/message.h b/src/libmime/message.h index cacb4287b..619154c6b 100644 --- a/src/libmime/message.h +++ b/src/libmime/message.h @@ -61,6 +61,7 @@ enum rspamd_received_type { RSPAMD_RECEIVED_ESMTP, RSPAMD_RECEIVED_ESMTPA, RSPAMD_RECEIVED_ESMTPS, + RSPAMD_RECEIVED_ESMTPSA, RSPAMD_RECEIVED_LMTP, RSPAMD_RECEIVED_IMAP, RSPAMD_RECEIVED_UNKNOWN diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 38402039b..15b0ae0b7 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -1439,7 +1439,7 @@ lua_task_get_received_headers (lua_State * L) if (G_UNLIKELY (rh->from_ip == NULL && rh->real_ip == NULL && rh->real_hostname == NULL && - rh->by_hostname == NULL)) { + rh->by_hostname == NULL && rh->timestamp == 0)) { continue; } @@ -1465,6 +1465,9 @@ lua_task_get_received_headers (lua_State * L) case RSPAMD_RECEIVED_ESMTPA: proto = "esmtpa"; break; + case RSPAMD_RECEIVED_ESMTPSA: + proto = "esmtpsa"; + break; case RSPAMD_RECEIVED_LMTP: proto = "lmtp"; break; diff --git a/src/ragel/smtp_received.rl b/src/ragel/smtp_received.rl index dd2212de3..e005dcc9c 100644 --- a/src/ragel/smtp_received.rl +++ b/src/ragel/smtp_received.rl @@ -15,6 +15,7 @@ "SMTP" %SMTP_proto | "ESMTPS" %ESMTPS_proto | "ESMTPA" %ESMTPA_proto | + "ESMTPSA" %ESMTPSA_proto | "LMTP" %LMTP_proto | "IMAP" %IMAP_proto | Attdl_Protocol; diff --git a/src/ragel/smtp_received_parser.rl b/src/ragel/smtp_received_parser.rl index bfd32eaaa..b2c73cab3 100644 --- a/src/ragel/smtp_received_parser.rl +++ b/src/ragel/smtp_received_parser.rl @@ -226,6 +226,9 @@ action ESMTP_proto { rh->type = RSPAMD_RECEIVED_ESMTP; } + action ESMTPSA_proto { + rh->type = RSPAMD_RECEIVED_ESMTPSA; + } action LMTP_proto { rh->type = RSPAMD_RECEIVED_LMTP; } |