Some email accounts use account names that include the @host portion,
and this broke the server and credentials parsing in smtp(1).  Sometimes
I see these @ characters encoded as %40, but smtp(1) was not decoding
these url escape sequences before base64 encoding and talking with the
server.

Searching for the last @ character instead of the first is a simple
fix.  This mail was sent using this diff.

diff 594937660a36a61c991da10e4d9f91c8e1cdb9d0 /usr/src
blob - deb99c6394e09f605db53cbdb1cddbf61ac72bf8
file + usr.sbin/smtpd/smtpc.c
--- usr.sbin/smtpd/smtpc.c
+++ usr.sbin/smtpd/smtpc.c
@@ -185,7 +185,7 @@ parse_server(char *server)
                *p = '\0';
                p += 3;
                /* check for credentials */
-               c = strchr(p, '@');
+               c = strrchr(p, '@');
                if (c) {
                        creds = p;
                        *c = '\0';

Reply via email to