From 03c9effd070d7e9a3d49f6a3d7f7c1a7a4d6bff3 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 3 Dec 2001 02:45:47 +0000 Subject: [PATCH] * Began implementing some code to handle multiple recipients (but #define'd it all out because we're approaching a release) --- citadel/ChangeLog | 5 +++ citadel/msgbase.c | 81 ++++++++++++++++++++++++++++++++++++++++++++--- citadel/msgbase.h | 11 +++++++ 3 files changed, 92 insertions(+), 5 deletions(-) diff --git a/citadel/ChangeLog b/citadel/ChangeLog index 8774438fa..56fb591f9 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,4 +1,8 @@ $Log$ + Revision 580.88 2001/12/03 02:45:46 ajc + * Began implementing some code to handle multiple recipients (but #define'd + it all out because we're approaching a release) + Revision 580.87 2001/12/03 01:50:17 ajc * When sending mail, copy to the sender's "Sent Items>" room instead of to the sender's "Mail>" room. @@ -2908,3 +2912,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/msgbase.c b/citadel/msgbase.c index 42491c8cc..2f90bb9ee 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -2145,6 +2145,71 @@ int CtdlDoIHavePermissionToPostInThisRoom(char *errmsgbuf) { } +#define NYI_FIXME +/* + * Validate recipients, count delivery types and errors, and handle aliasing + */ +struct recptypes *validate_recipients(char *recipients) { + struct recptypes *ret; + char this_recp[SIZ]; + int num_recps; + int i; + int mailtype; + struct usersupp tempUS; + + /* Initialize */ + ret = (struct recptypes *) malloc(sizeof(struct recptypes)); + if (ret == NULL) return(NULL); + memset(ret, 0, sizeof(struct recptypes)); + + ret->num_local = 0; + ret->num_internet = 0; + ret->num_ignet = 0; + ret->num_error = 0; + + if (recipients == NULL) return(ret); + if (strlen(recipients) == NULL) return(ret); + + /* Allow either , or ; separators by changing ; to , */ + for (i=0; i\n", i, this_recp); + mailtype = alias(this_recp); + switch(mailtype) { + case MES_LOCAL: + if (getuser(&tempUS, buf) == 0) { + ++ret->num_local; + } + else { + ++ret->num_error; + } + break; + case MES_INTERNET: + ++ret->num_internet; + break; + case MES_IGNET: + ++ret->num_ignet; + break; + case MES_ERROR: + ++ret->num_error; + break; + } + + } + + return(ret); +} +#endif NYI_FIXME + /* @@ -2198,8 +2263,10 @@ void cmd_ent0(char *entargs) if (CC->quickroom.QRflags & QR_MAILBOX) { if (CC->usersupp.axlevel >= 2) { strcpy(buf, recipient); - } else + } + else { strcpy(buf, "sysop"); + } e = alias(buf); /* alias and mail type */ if ((buf[0] == 0) || (e == MES_ERROR)) { cprintf("%d Unknown address - cannot send message.\n", @@ -2260,21 +2327,25 @@ void cmd_ent0(char *entargs) cprintf("%d send message\n", SEND_LISTING); /* Read in the message from the client. */ - if (CC->fake_postname[0]) + if (CC->fake_postname[0]) { msg = make_message(&CC->usersupp, buf, CC->quickroom.QRname, b, e, format_type, CC->fake_postname); - else if (CC->fake_username[0]) + } + else if (CC->fake_username[0]) { msg = make_message(&CC->usersupp, buf, CC->quickroom.QRname, b, e, format_type, CC->fake_username); - else + } + else { msg = make_message(&CC->usersupp, buf, CC->quickroom.QRname, b, e, format_type, ""); + } - if (msg != NULL) + if (msg != NULL) { CtdlSaveMsg(msg, buf, (mtsflag ? AIDEROOM : ""), e); CtdlFreeMessage(msg); + } CC->fake_postname[0] = '\0'; return; } diff --git a/citadel/msgbase.h b/citadel/msgbase.h index 01bbb9791..90dae4256 100644 --- a/citadel/msgbase.h +++ b/citadel/msgbase.h @@ -43,6 +43,17 @@ struct repl { /* Info for replication checking */ }; +/* Data structure returned by validate_recipients() */ +struct recptypes { + int num_local; + int num_internet; + int num_ignet; + int num_error; + char errormsg[SIZ]; +}; + + + int alias (char *name); void get_mm (void); void cmd_msgs (char *cmdbuf); -- 2.30.2