validate_recipients() - completed removal of unused param
authorArt Cancro <ajc@citadel.org>
Wed, 27 Mar 2024 19:56:30 +0000 (12:56 -0700)
committerArt Cancro <ajc@citadel.org>
Wed, 27 Mar 2024 19:56:30 +0000 (12:56 -0700)
14 files changed:
citadel/server/internet_addressing.c
citadel/server/internet_addressing.h
citadel/server/journaling.c
citadel/server/modules/calendar/serv_calendar.c
citadel/server/modules/ctdlproto/serv_messages.c
citadel/server/modules/imap/imap_acl.c
citadel/server/modules/inboxrules/serv_inboxrules.c
citadel/server/modules/listdeliver/serv_listdeliver.c
citadel/server/modules/smtp/serv_smtp.c
citadel/server/modules/smtp/smtp_util.c
citadel/server/modules/smtp/smtp_util.h
citadel/server/modules/vcard/serv_vcard.c
citadel/server/msgbase.c
citadel/server/user_ops.c

index 0bc7507043ca955a99fbfe271a076cf35e294641..e1a9e2ff0e2119795ddfee6b0fb4e9cc87dbb393 100644 (file)
@@ -87,7 +87,7 @@ int CtdlIsMe(char *addr, int addr_buf_len) {
        struct recptypes *recp;
        int i;
 
-       recp = validate_recipients(addr, NULL, 0);
+       recp = validate_recipients(addr, 0);
        if (recp == NULL) return(0);
 
        if (recp->num_local == 0) {
@@ -295,7 +295,7 @@ Array *split_recps(char *addresses, Array *append_to) {
 //
 // Caller needs to free the result using free_recipients()
 //
-struct recptypes *validate_recipients(char *recipients_in, const char *REMOVE_THIS_UNUSED_VARIABLE, int Flags) {
+struct recptypes *validate_recipients(char *recipients_in, int Flags) {
        struct recptypes *ret;
        char append[SIZ];
        long len;
index 0f3793858a9ad79baad5de259332cd1b527b9a46..16f1a016425466d24c2199f89312e7902c58744a 100644 (file)
@@ -2,7 +2,7 @@
 #include "server.h"
 #include "ctdl_module.h"
 
-struct recptypes *validate_recipients(char *recipients, const char *RemoteIdentifier, int Flags);
+struct recptypes *validate_recipients(char *recipients, int Flags);
 void free_recipients(struct recptypes *);
 void process_rfc822_addr(const char *rfc822, char *user, char *node, char *name);
 char *rfc822_fetch_field(const char *rfc822, const char *fieldname);
index cce21fa24412b04c189a8c812fbb115362ed516b..04054349b8812237dc1fa11e908814f74816fa0b 100644 (file)
@@ -85,7 +85,7 @@ void JournalRunQueueMsg(struct jnlq *jmsg) {
 
        if (jmsg == NULL)
                return;
-       journal_recps = validate_recipients(CtdlGetConfigStr("c_journal_dest"), NULL, 0);
+       journal_recps = validate_recipients(CtdlGetConfigStr("c_journal_dest"), 0);
        if (journal_recps != NULL) {
 
                if (  (journal_recps->num_local > 0)
index 17b80b0dd7d2b722c30b9ff94e3a7351fd13f080..eaf8d238f075d1304823892fc676520c3de64db6 100644 (file)
@@ -177,7 +177,7 @@ void ical_send_a_reply(icalcomponent *request, char *action) {
                        if ((ch != NULL) && !strncasecmp(ch, "MAILTO:", 7)) {
                                safestrncpy(attendee_string, ch + 7, sizeof (attendee_string));
                                string_trim(attendee_string);
-                               recp = validate_recipients(attendee_string, NULL, 0);
+                               recp = validate_recipients(attendee_string, 0);
                                if (recp != NULL) {
                                        if (!strcasecmp(recp->recp_local, CC->user.fullname)) {
                                                if (me_attend) icalproperty_free(me_attend);
@@ -266,7 +266,7 @@ void ical_send_a_reply(icalcomponent *request, char *action) {
                );
        
                if (msg != NULL) {
-                       valid = validate_recipients(organizer_string, NULL, 0);
+                       valid = validate_recipients(organizer_string, 0);
                        CtdlSubmitMsg(msg, valid, "");
                        CM_Free(msg);
                        free_recipients(valid);
@@ -1258,7 +1258,7 @@ void ical_freebusy(char *who) {
        // If not found, try it as an unqualified email address.
        if (found_user != 0) {
                strcpy(buf, who);
-               recp = validate_recipients(buf, NULL, 0);
+               recp = validate_recipients(buf, 0);
                syslog(LOG_DEBUG, "calendar: trying <%s>", buf);
                if (recp != NULL) {
                        if (recp->num_local == 1) {
@@ -1272,7 +1272,7 @@ void ical_freebusy(char *who) {
        if (found_user != 0) {
                snprintf(buf, sizeof buf, "%s@%s", who, CtdlGetConfigStr("c_fqdn"));
                syslog(LOG_DEBUG, "calendar: trying <%s>", buf);
-               recp = validate_recipients(buf, NULL, 0);
+               recp = validate_recipients(buf, 0);
                if (recp != NULL) {
                        if (recp->num_local == 1) {
                                found_user = CtdlGetUser(&usbuf, recp->recp_local);
@@ -1294,7 +1294,7 @@ void ical_freebusy(char *who) {
                        ) {
                                snprintf(buf, sizeof buf, "%s@%s", who, host);
                                syslog(LOG_DEBUG, "calendar: trying <%s>", buf);
-                               recp = validate_recipients(buf, NULL, 0);
+                               recp = validate_recipients(buf, 0);
                                if (recp != NULL) {
                                        if (recp->num_local == 1) {
                                                found_user = CtdlGetUser(&usbuf, recp->recp_local);
@@ -1903,7 +1903,7 @@ void ical_send_out_invitations(icalcomponent *top_level_cal, icalcomponent *cal)
                );
        
                if (msg != NULL) {
-                       valid = validate_recipients(attendees_string, NULL, 0);
+                       valid = validate_recipients(attendees_string, 0);
                        CtdlSubmitMsg(msg, valid, "");
                        CM_Free(msg);
                        free_recipients(valid);
index 9a85f263b716ac28c1b5685d73a58d9ea46b9e31..2c3b4371eef2230e470772ed5267ee01c0f26616 100644 (file)
@@ -476,14 +476,14 @@ void cmd_ent0(char *entargs) {
                        strcpy(bcc, "");
                }
 
-               valid_to = validate_recipients(recp, NULL, 0);
+               valid_to = validate_recipients(recp, 0);
                if (valid_to->num_error > 0) {
                        cprintf("%d %s\n", ERROR + NO_SUCH_USER, valid_to->errormsg);
                        free_recipients(valid_to);
                        return;
                }
 
-               valid_cc = validate_recipients(cc, NULL, 0);
+               valid_cc = validate_recipients(cc, 0);
                if (valid_cc->num_error > 0) {
                        cprintf("%d %s\n", ERROR + NO_SUCH_USER, valid_cc->errormsg);
                        free_recipients(valid_to);
@@ -491,7 +491,7 @@ void cmd_ent0(char *entargs) {
                        return;
                }
 
-               valid_bcc = validate_recipients(bcc, NULL, 0);
+               valid_bcc = validate_recipients(bcc, 0);
                if (valid_bcc->num_error > 0) {
                        cprintf("%d %s\n", ERROR + NO_SUCH_USER, valid_bcc->errormsg);
                        free_recipients(valid_to);
@@ -614,7 +614,7 @@ void cmd_ent0(char *entargs) {
                strcat(all_recps, bcc);
        }
        if (!IsEmptyStr(all_recps)) {
-               valid = validate_recipients(all_recps, NULL, 0);
+               valid = validate_recipients(all_recps, 0);
        }
        else {
                valid = NULL;
index 7965322e0b103ae3919aabaef58abda38ef8600b..b69fe6efdcbbdf02117f53a5a2dad95152023f92 100644 (file)
@@ -187,7 +187,7 @@ void imap_listrights(int num_parms, ConstStr *Params) {
 
        // Search for the specified user
        ret = (-1);
-       valid = validate_recipients(Params[3].Key, NULL, 0);
+       valid = validate_recipients(Params[3].Key, 0);
        if (valid != NULL) {
                if (valid->num_local == 1) {
                        ret = CtdlGetUser(&temp, valid->recp_local);
index 5c01625af9bb447f11ecf41c438f4f4fa590e55f..66018785e662b6a445deee75fddd8b4a2178b624 100644 (file)
@@ -342,7 +342,7 @@ int inbox_do_redirect(struct irule *rule, long msgnum) {
                return(1);                                      // don't delete the inbox copy if this failed
        }
 
-       struct recptypes *valid = validate_recipients(rule->redirect_to, NULL, 0);
+       struct recptypes *valid = validate_recipients(rule->redirect_to, 0);
        if (valid == NULL) {
                syslog(LOG_WARNING, "inboxrules: inbox_do_redirect() invalid recipient <%s>", rule->redirect_to);
                return(1);                                      // don't delete the inbox copy if this failed
index aff0453bb63b8f8392d0697f5e00a626ce1bc4e7..c342b0799d087cf6054f7115ba7ca32cb27a37f4 100644 (file)
@@ -104,7 +104,7 @@ void listdeliver_do_msg(long msgnum, void *userdata) {
                snprintf(bounce_to, sizeof bounce_to, "room_aide@%s", CtdlGetConfigStr("c_fqdn"));
 
                // Now submit the message
-               struct recptypes *valid = validate_recipients(recipients, NULL, 0);
+               struct recptypes *valid = validate_recipients(recipients, 0);
                if (valid) {
                        valid->bounce_to = strdup(bounce_to);
                        valid->envelope_from = strdup(bounce_to);
index 005f5b5d7746fc5eb814f82500dc5256ed5086dd..b153207567cbf0aebb36357624d57e7cb2fe5b0d 100644 (file)
@@ -609,7 +609,6 @@ void smtp_rcpt(void) {
        // This is a *preliminary* call to validate_recipients() to evaluate one recipient.
        valid = validate_recipients(
                (char *)ChrPtr(SMTP->OneRcpt), 
-               smtp_get_Recipients(),
                (SMTP->is_lmtp)? POST_LMTP: (CC->logged_in)? POST_LOGGED_IN: POST_EXTERNAL
        );
 
@@ -784,7 +783,6 @@ void smtp_data(void) {
        // Submit the message into the Citadel system.
        valid = validate_recipients(
                (char *)ChrPtr(SMTP->recipients),
-               smtp_get_Recipients(),
                (SMTP->is_lmtp)? POST_LMTP: (CC->logged_in)? POST_LOGGED_IN: POST_EXTERNAL
        );
 
index 29534ab69ca53fe312a976341bbfaafa04dd3ea8..0ae6f35997cd9d62f8057eacec0865bcbe6e088d 100644 (file)
 #include "../../ctdl_module.h"
 #include "smtp_util.h"
 
-const char *smtp_get_Recipients(void) {
-       struct citsmtp *sSMTP = SMTP;
-
-       if (sSMTP == NULL) {
-               return NULL;
-       }
-       else return ChrPtr(sSMTP->from);
-}
-
 
 /*
  * smtp_do_bounce() is caled by smtp_process_one_msg() to scan a set of delivery
index ea2433c7992f1129e92db1230a5eab692acccd26..d02a53fadcbbb91fe8e6f5ca99d6635fea22bca1 100644 (file)
@@ -11,8 +11,6 @@
  *
  */
 
-const char *smtp_get_Recipients(void);
-
 struct citsmtp {               /* Information about the current session */
        int command_state;
        StrBuf *Cmd;
index 56451eef941a5a270e6b49a68093693e546e3409..cbf40ed103465f63c1f00d0b51af8763aa1786b9 100644 (file)
@@ -889,7 +889,7 @@ void check_get(void) {
                char *argbuf = &cmdbuf[4];
                
                extract_token(internet_addr, argbuf, 0, '|', sizeof internet_addr);
-               rcpt = validate_recipients(internet_addr, NULL, CHECK_EXIST);
+               rcpt = validate_recipients(internet_addr, CHECK_EXIST);
                if (    (rcpt != NULL) &&
                        (
                                (*rcpt->recp_local != '\0') ||
index fb3f74ae791b6cf99b50fe2cebb4783512f6fbc2..b3a8f7071c66a9a3ee651dcc2e9feba089886e68 100644 (file)
@@ -2768,7 +2768,7 @@ long quickie_message(char *from,
        if (!IsEmptyStr(room)) CM_SetField(msg, eOriginalRoom, room);
        if (!IsEmptyStr(to)) {
                CM_SetField(msg, eRecipient, to);
-               recp = validate_recipients(to, NULL, 0);
+               recp = validate_recipients(to, 0);
        }
        if (!IsEmptyStr(subject)) {
                CM_SetField(msg, eMsgSubject, subject);
index 61183bcc06c1274834c2bff5f5a26278aa372e07..e35b00a27e71b222b20c5f3772b9b7aaac255552 100644 (file)
@@ -505,7 +505,7 @@ int CtdlLoginExistingUser(const char *trythisname) {
        
                // If that didn't work, try to log in as if the supplied name * is an e-mail address
                if (found_user != 0) {
-                       valid = validate_recipients(username, NULL, 0);
+                       valid = validate_recipients(username, 0);
                        if (valid != NULL) {
                                if (valid->num_local == 1) {
                                        found_user = CtdlGetUser(&CC->user, valid->recp_local);