validate_recipients(): don't send mail to user 0
authorArt Cancro <ajc@citadel.org>
Sat, 9 Sep 2023 00:51:54 +0000 (20:51 -0400)
committerArt Cancro <ajc@citadel.org>
Sat, 9 Sep 2023 00:51:54 +0000 (20:51 -0400)
citadel/server/internet_addressing.c

index 4108b41f12598333ba234751ece925317447a8b6..05a0e900a236a04de7523ae8d2b128603d3f08bb 100644 (file)
@@ -429,7 +429,8 @@ struct recptypes *validate_recipients(char *supplied_recipients, const char *Rem
                        }
 
                        // This handles the most common case, which is mail to a user's inbox.
-                       else if (CtdlGetUser(&tempUS, this_recp) == 0) {
+                       // (the next line depends on left-to-right evaluation)
+                       else if ((CtdlGetUser(&tempUS, this_recp) == 0) && (tempUS.usernum > 0)) {
                                ++ret->num_local;
                                strcpy(this_recp, tempUS.fullname);
                                if (!IsEmptyStr(ret->recp_local)) {