From: Art Cancro Date: Wed, 27 Mar 2024 19:56:30 +0000 (-0700) Subject: validate_recipients() - completed removal of unused param X-Git-Tag: v999~7 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=1d8bbd8d311dc3f70985d9087df4b499db9c4327 validate_recipients() - completed removal of unused param --- diff --git a/citadel/server/internet_addressing.c b/citadel/server/internet_addressing.c index 0bc750704..e1a9e2ff0 100644 --- a/citadel/server/internet_addressing.c +++ b/citadel/server/internet_addressing.c @@ -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; diff --git a/citadel/server/internet_addressing.h b/citadel/server/internet_addressing.h index 0f3793858..16f1a0164 100644 --- a/citadel/server/internet_addressing.h +++ b/citadel/server/internet_addressing.h @@ -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); diff --git a/citadel/server/journaling.c b/citadel/server/journaling.c index cce21fa24..04054349b 100644 --- a/citadel/server/journaling.c +++ b/citadel/server/journaling.c @@ -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) diff --git a/citadel/server/modules/calendar/serv_calendar.c b/citadel/server/modules/calendar/serv_calendar.c index 17b80b0dd..eaf8d238f 100644 --- a/citadel/server/modules/calendar/serv_calendar.c +++ b/citadel/server/modules/calendar/serv_calendar.c @@ -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); diff --git a/citadel/server/modules/ctdlproto/serv_messages.c b/citadel/server/modules/ctdlproto/serv_messages.c index 9a85f263b..2c3b4371e 100644 --- a/citadel/server/modules/ctdlproto/serv_messages.c +++ b/citadel/server/modules/ctdlproto/serv_messages.c @@ -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; diff --git a/citadel/server/modules/imap/imap_acl.c b/citadel/server/modules/imap/imap_acl.c index 7965322e0..b69fe6efd 100644 --- a/citadel/server/modules/imap/imap_acl.c +++ b/citadel/server/modules/imap/imap_acl.c @@ -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); diff --git a/citadel/server/modules/inboxrules/serv_inboxrules.c b/citadel/server/modules/inboxrules/serv_inboxrules.c index 5c01625af..66018785e 100644 --- a/citadel/server/modules/inboxrules/serv_inboxrules.c +++ b/citadel/server/modules/inboxrules/serv_inboxrules.c @@ -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 diff --git a/citadel/server/modules/listdeliver/serv_listdeliver.c b/citadel/server/modules/listdeliver/serv_listdeliver.c index aff0453bb..c342b0799 100644 --- a/citadel/server/modules/listdeliver/serv_listdeliver.c +++ b/citadel/server/modules/listdeliver/serv_listdeliver.c @@ -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); diff --git a/citadel/server/modules/smtp/serv_smtp.c b/citadel/server/modules/smtp/serv_smtp.c index 005f5b5d7..b15320756 100644 --- a/citadel/server/modules/smtp/serv_smtp.c +++ b/citadel/server/modules/smtp/serv_smtp.c @@ -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 ); diff --git a/citadel/server/modules/smtp/smtp_util.c b/citadel/server/modules/smtp/smtp_util.c index 29534ab69..0ae6f3599 100644 --- a/citadel/server/modules/smtp/smtp_util.c +++ b/citadel/server/modules/smtp/smtp_util.c @@ -50,15 +50,6 @@ #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 diff --git a/citadel/server/modules/smtp/smtp_util.h b/citadel/server/modules/smtp/smtp_util.h index ea2433c79..d02a53fad 100644 --- a/citadel/server/modules/smtp/smtp_util.h +++ b/citadel/server/modules/smtp/smtp_util.h @@ -11,8 +11,6 @@ * */ -const char *smtp_get_Recipients(void); - struct citsmtp { /* Information about the current session */ int command_state; StrBuf *Cmd; diff --git a/citadel/server/modules/vcard/serv_vcard.c b/citadel/server/modules/vcard/serv_vcard.c index 56451eef9..cbf40ed10 100644 --- a/citadel/server/modules/vcard/serv_vcard.c +++ b/citadel/server/modules/vcard/serv_vcard.c @@ -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') || diff --git a/citadel/server/msgbase.c b/citadel/server/msgbase.c index fb3f74ae7..b3a8f7071 100644 --- a/citadel/server/msgbase.c +++ b/citadel/server/msgbase.c @@ -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); diff --git a/citadel/server/user_ops.c b/citadel/server/user_ops.c index 61183bcc0..e35b00a27 100644 --- a/citadel/server/user_ops.c +++ b/citadel/server/user_ops.c @@ -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);