Removed support for ...bang!paths and user%node1@node2 syntaxes
authorArt Cancro <ajc@citadel.org>
Wed, 2 Nov 2022 20:08:58 +0000 (16:08 -0400)
committerArt Cancro <ajc@citadel.org>
Wed, 2 Nov 2022 20:08:58 +0000 (16:08 -0400)
citadel/server/internet_addressing.c

index 31e3fe2d8762a3a4c560878b6958a2d7dfddd8be..d9a363a23ac8ec5de5b8c3abe1db2029c86c34af 100644 (file)
@@ -713,9 +713,6 @@ void unfold_rfc822_field(char **field, char **FieldEnd)
 
 
 // Split an RFC822-style address into userid, host, and full name
-//
-// Note: This still handles obsolete address syntaxes such as user%node@node and ...node!user
-//       We should probably remove that.
 void process_rfc822_addr(const char *rfc822, char *user, char *node, char *name) {
        int a;
 
@@ -729,20 +726,12 @@ void process_rfc822_addr(const char *rfc822, char *user, char *node, char *name)
        strcpy(name, rfc822);
        stripout(name, '<', '>');
 
-       // strip anything to the left of a bang
-       while ((!IsEmptyStr(name)) && (haschar(name, '!') > 0))
-               strcpy(name, &name[1]);
-
-       // and anything to the right of a @ or %
+       // and anything to the right of a @
        for (a = 0; name[a] != '\0'; ++a) {
                if (name[a] == '@') {
                        name[a] = 0;
                        break;
                }
-               if (name[a] == '%') {
-                       name[a] = 0;
-                       break;
-               }
        }
 
        // but if there are parentheses, that changes the rules...
@@ -775,23 +764,14 @@ void process_rfc822_addr(const char *rfc822, char *user, char *node, char *name)
                stripallbut(user, '<', '>');
        }
 
-       // strip anything to the left of a bang
-       while ((!IsEmptyStr(user)) && (haschar(user, '!') > 0))
-               strcpy(user, &user[1]);
-
-       // and anything to the right of a @ or %
+       // and anything to the right of a @
        for (a = 0; user[a] != '\0'; ++a) {
                if (user[a] == '@') {
                        user[a] = 0;
                        break;
                }
-               if (user[a] == '%') {
-                       user[a] = 0;
-                       break;
-               }
        }
 
-
        // extract node name
        strcpy(node, rfc822);
 
@@ -804,33 +784,14 @@ void process_rfc822_addr(const char *rfc822, char *user, char *node, char *name)
        }
 
        // If no node specified, tack ours on instead
-       if (
-               (haschar(node, '@')==0)
-               && (haschar(node, '%')==0)
-               && (haschar(node, '!')==0)
-       ) {
+       if (haschar(node, '@') == 0) {
                strcpy(node, CtdlGetConfigStr("c_nodename"));
        }
        else {
-
                // strip anything to the left of a @
-               while ((!IsEmptyStr(node)) && (haschar(node, '@') > 0))
-                       strcpy(node, &node[1]);
-       
-               // strip anything to the left of a %
-               while ((!IsEmptyStr(node)) && (haschar(node, '%') > 0))
-                       strcpy(node, &node[1]);
-       
-               // reduce multiple system bang paths to node!user
-               while ((!IsEmptyStr(node)) && (haschar(node, '!') > 1))
+               while ((!IsEmptyStr(node)) && (haschar(node, '@') > 0)) {
                        strcpy(node, &node[1]);
-       
-               // now get rid of the user portion of a node!user string
-               for (a = 0; node[a] != '\0'; ++a)
-                       if (node[a] == '!') {
-                               node[a] = 0;
-                               break;
-                       }
+               }
        }
 
        // strip leading and trailing spaces in all strings