sendmail allow "=" symbol in recipient, closes 10241
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 5 Oct 2017 15:18:23 +0000 (17:18 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 5 Oct 2017 15:18:23 +0000 (17:18 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
mailutils/sendmail.c

index defbd955263c9202b22a5a5eec6d853d01616418..4ca91fad8e9c85975a457fed68639428c778c443 100644 (file)
@@ -150,7 +150,13 @@ static char *sane_address(char *str)
        trim(str);
        s = str;
        while (*s) {
-               if (!isalnum(*s) && !strchr("+_-.@", *s)) {
+               /* Standard allows these chars in username without quoting:
+                * /!#$%&'*+-=?^_`{|}~
+                * and allows dot (.) with some restrictions.
+                * I chose to only allow a saner subset.
+                * I propose to expand it only on user's request.
+                */
+               if (!isalnum(*s) && !strchr("=+_-.@", *s)) {
                        bb_error_msg("bad address '%s'", str);
                        /* returning "": */
                        str[0] = '\0';