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) {
//
// 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;
#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);
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)
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);
);
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);
// 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) {
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);
) {
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);
);
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);
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);
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);
strcat(all_recps, bcc);
}
if (!IsEmptyStr(all_recps)) {
- valid = validate_recipients(all_recps, NULL, 0);
+ valid = validate_recipients(all_recps, 0);
}
else {
valid = NULL;
// 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);
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
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);
// 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
);
// 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
);
#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
*
*/
-const char *smtp_get_Recipients(void);
-
struct citsmtp { /* Information about the current session */
int command_state;
StrBuf *Cmd;
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') ||
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);
// 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);