diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-04-01 16:18:48 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-04-01 16:18:48 +0100 |
commit | 65fa8ec6a06155c1c47de665ab80c746945279c1 (patch) | |
tree | 5c7b3b09a86b111f5eb42eb5e1a9d6d0d5a34e5c /src/libserver/milter.c | |
parent | b5f27c26e17f3ed6898b6f503773729c6e60985d (diff) | |
download | rspamd-65fa8ec6a06155c1c47de665ab80c746945279c1.tar.gz rspamd-65fa8ec6a06155c1c47de665ab80c746945279c1.zip |
[Minor] Ignore 'unknown' hostname via milter
Diffstat (limited to 'src/libserver/milter.c')
-rw-r--r-- | src/libserver/milter.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/libserver/milter.c b/src/libserver/milter.c index 7e199e1b7..c4c7a171f 100644 --- a/src/libserver/milter.c +++ b/src/libserver/milter.c @@ -1406,6 +1406,7 @@ rspamd_milter_to_http (struct rspamd_milter_session *session) struct rspamd_http_message *msg; guint i; struct rspamd_email_address *rcpt; + struct rspamd_milter_private *priv = session->priv; g_assert (session != NULL); @@ -1419,9 +1420,16 @@ rspamd_milter_to_http (struct rspamd_milter_session *session) session->message = NULL; } - if (session->hostname && session->hostname->len > 0) { - rspamd_http_message_add_header_fstr (msg, HOSTNAME_HEADER, - session->hostname); + if (session->hostname && RSPAMD_FSTRING_LEN (session->hostname) > 0) { + if (!(session->hostname->len == sizeof ("unknown") - 1 && + memcmp (RSPAMD_FSTRING_DATA (session->hostname), "unknown", + sizeof ("unknown") - 1) == 0)) { + rspamd_http_message_add_header_fstr (msg, HOSTNAME_HEADER, + session->hostname); + } + else { + msg_debug_milter ("skip unknown hostname from being added"); + } } if (session->helo && session->helo->len > 0) { |