From f71ebdb41018239c28202870e5ad9bf45af5479f Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 18 Jul 2017 19:44:22 +0100 Subject: [PATCH] [Fix] Add workaround for IPv6 in sendmail Issue: #1760 --- src/libserver/milter.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libserver/milter.c b/src/libserver/milter.c index 4f235c2aa..aa19ada33 100644 --- a/src/libserver/milter.c +++ b/src/libserver/milter.c @@ -375,6 +375,13 @@ rspamd_milter_process_command (struct rspamd_milter_session *session, case RSPAMD_MILTER_CONN_INET6: session->addr = rspamd_inet_address_new (AF_INET, NULL); + if (zero - pos > sizeof ("IPv6:") && + rspamd_lc_cmp (pos, "IPv6:", + sizeof ("IPv6:") - 1) == 0) { + /* Kill sendmail please */ + pos += sizeof ("IPv6:") - 1; + } + if (!rspamd_parse_inet_address_ip (pos, zero - pos, session->addr)) { err = g_error_new (rspamd_milter_quark (), EINVAL, -- 2.39.5