Enforce stricter rfc helo compliance.
-- 
Edgar Pettijohn
Index: util.c
===================================================================
RCS file: /cvs/src/usr.sbin/smtpd/util.c,v
retrieving revision 1.128
diff -u -p -u -r1.128 util.c
--- util.c      31 Aug 2016 10:18:08 -0000      1.128
+++ util.c      25 Sep 2016 01:41:34 -0000
@@ -495,6 +495,9 @@ valid_domainpart(const char *s)
        struct in6_addr  ina6;
        char            *c, domain[SMTPD_MAXDOMAINPARTSIZE];
        const char      *p;
+       size_t          len;
+
+       len = strlen(s);
 
        if (*s == '[') {
                if (strncasecmp("[IPv6:", s, 6) == 0)
@@ -519,8 +522,9 @@ valid_domainpart(const char *s)
                return 0;
        }
 
-       if (*s == '\0')
+       if (*s == '\0' || s[0] == '.' || s[len - 1] == '.') {
                return 0;
+       }
 
        return res_hnok(s);
 }

Reply via email to