]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Add workaround for IPv6 in sendmail
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 18 Jul 2017 18:44:22 +0000 (19:44 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 18 Jul 2017 18:44:22 +0000 (19:44 +0100)
Issue: #1760

src/libserver/milter.c

index 4f235c2aae09ef004c474ad27f13ac27f786be37..aa19ada3305dfd287e5da1b80e662fc2c9b57535 100644 (file)
@@ -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,