]> code.citadel.org Git - citadel.git/blobdiff - citadel/internet_addressing.c
* Better handling of incoming Internet addresses consisting of an address
[citadel.git] / citadel / internet_addressing.c
index 50da226926d6515b14c3ebc0855138fc31094cd3..fd16a6f1813e1bb1385b859be08d00c2e3690369 100644 (file)
@@ -268,6 +268,14 @@ void process_rfc822_addr(const char *rfc822, char *user, char *node, char *name)
        striplt(user);
        striplt(node);
        striplt(name);
+
+       /* If we processed a string that had the address in angle brackets
+        * but no name outside the brackets, we now have an empty name.  In
+        * this case, use the user portion of the address as the name.
+        */
+       if ((strlen(name) == 0) && (strlen(user) > 0)) {
+               strcpy(name, user);
+       }
 }