* Cc: and Bcc: support. Not finished yet.
authorArt Cancro <ajc@citadel.org>
Fri, 16 Sep 2005 04:23:21 +0000 (04:23 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 16 Sep 2005 04:23:21 +0000 (04:23 +0000)
13 files changed:
citadel/ChangeLog
citadel/citserver.c
citadel/imap_misc.c
citadel/msgbase.c
citadel/msgbase.h
citadel/serv_calendar.c
citadel/serv_chat.c
citadel/serv_network.c
citadel/serv_smtp.c
citadel/serv_vcard.c
citadel/server.h
citadel/techdoc/hack.txt
citadel/techdoc/protocol.txt

index c10e93aed64ed338e9d455ada17a9adb3fc085fa..f69374021f8f4d9fcc29bbbac84e85470fe95346 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 655.5  2005/09/16 04:23:21  ajc
+* Cc: and Bcc: support.  Not finished yet.
+
 Revision 655.4  2005/09/15 21:37:06  ajc
 * Restructured cmd_auto() to be able to search vCards in more than one room.
   For now we are using the Global Address Book as the second room, but in
@@ -7124,3 +7127,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import
+
index 76e2f258c29eaf43f4a1b29e051979e57af6e38c..edbffb3d8d747e263c04e51047b0752abe8957c6 100644 (file)
@@ -907,7 +907,7 @@ void citproto_begin_session() {
  * This loop recognizes all server commands.
  */
 void do_command_loop(void) {
-       char cmdbuf[1024];
+       char cmdbuf[SIZ];
 
        time(&CC->lastcmd);
        memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */
index 00c652f277dfd4a7d4c2acd9883956d384874ab2..192f9c833878c9f5d2c596891297a4a74b6c8ea9 100644 (file)
@@ -398,7 +398,7 @@ void imap_append(int num_parms, char *parms[]) {
        else {
                /* Yes ... go ahead and post! */
                if (msg != NULL) {
-                       new_msgnum = CtdlSubmitMsg(msg, NULL, "");
+                       new_msgnum = CtdlSubmitMsg(msg, NULL, NULL, NULL, "");
                }
                if (new_msgnum >= 0L) {
                        cprintf("%s OK APPEND completed\r\n", parms[0]);
index 7544cfadbf067c54abee9160e4f69e5d44e7a481..1f8fde2c919f36e07972b51df6d2cd9070481425 100644 (file)
@@ -97,7 +97,7 @@ char *msgkeys[] = {
        NULL,
        NULL,
        NULL,
-       NULL,
+       "cccc",
        NULL
 };
 
@@ -1429,6 +1429,9 @@ int CtdlOutputPreLoadedMsg(
                                        safestrncpy(luser, mptr, sizeof luser);
                                        safestrncpy(suser, mptr, sizeof suser);
                                }
+                               else if (i == 'Y') {
+                                       cprintf("CC: %s%s", mptr, nl);
+                               }
                                else if (i == 'U') {
                                        cprintf("Subject: %s%s", mptr, nl);
                                        subject_found = 1;
@@ -2035,7 +2038,9 @@ int ReplicationChecks(struct CtdlMessage *msg) {
  * Save a message to disk and submit it into the delivery system.
  */
 long CtdlSubmitMsg(struct CtdlMessage *msg,    /* message to save */
-               struct recptypes *recps,        /* recipients (if mail) */
+               struct recptypes *recps_to,     /* To: recipients (if mail) */
+               struct recptypes *recps_cc,     /* Cc: recipients (if mail) */
+               struct recptypes *recps_bcc,    /* Bcc: recipients (if mail) */
                char *force                     /* force a particular room? */
 ) {
        char submit_filename[128];
@@ -2056,6 +2061,9 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,       /* message to save */
        char *instr;
        struct ser_ret smr;
        char *hold_R, *hold_D;
+       int is_internet_mail = 0;
+       int force_to_sent = 0;                  /* Force to 'sent items' room */
+       size_t tmp;
 
        lprintf(CTDL_DEBUG, "CtdlSubmitMsg() called\n");
        if (is_valid_message(msg) == 0) return(-1);     /* self check */
@@ -2125,13 +2133,16 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,     /* message to save */
        }
 
        /* Goto the correct room */
-       lprintf(CTDL_DEBUG, "Selected room %s\n",
-               (recps) ? CC->room.QRname : SENTITEMS);
+       force_to_sent = 0;
+       if (recps_to) force_to_sent = 1;
+       if (recps_cc) force_to_sent = 1;
+       if (recps_bcc) force_to_sent = 1;
        strcpy(hold_rm, CC->room.QRname);
        strcpy(actual_rm, CC->room.QRname);
-       if (recps != NULL) {
+       if (force_to_sent) {
                strcpy(actual_rm, SENTITEMS);
        }
+       lprintf(CTDL_DEBUG, "Selected room %s\n", actual_rm);
 
        /* If the user is a twit, move to the twit room for posting */
        lprintf(CTDL_DEBUG, "Handling twit stuff: %s\n",
@@ -2215,7 +2226,7 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,       /* message to save */
         * message, we want to BYPASS saving the sender's copy (because there
         * is no local sender; it would otherwise go to the Trashcan).
         */
-       if ((!CC->internal_pgm) || (recps == NULL)) {
+       if ((!CC->internal_pgm) || ((recps_to == NULL) && (recps_cc == NULL) && (recps_bcc == NULL))) {
                if (CtdlSaveMsgPointerInRoom(actual_rm, newmsgid, 0) != 0) {
                        lprintf(CTDL_ERR, "ERROR saving message pointer!\n");
                        CtdlSaveMsgPointerInRoom(config.c_aideroom,
@@ -2224,16 +2235,20 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,     /* message to save */
        }
 
        /* For internet mail, drop a copy in the outbound queue room */
-       if (recps != NULL)
-        if (recps->num_internet > 0) {
+       is_internet_mail = 0;
+       if (recps_to != NULL)   is_internet_mail = recps_to->num_internet;
+       if (recps_cc != NULL)   is_internet_mail = recps_cc->num_internet;
+       if (recps_bcc != NULL)  is_internet_mail = recps_bcc->num_internet;
+       if (is_internet_mail) {
                CtdlSaveMsgPointerInRoom(SMTP_SPOOLOUT_ROOM, newmsgid, 0);
        }
 
-       /* If other rooms are specified, drop them there too. */
-       if (recps != NULL)
-        if (recps->num_room > 0)
-         for (i=0; i<num_tokens(recps->recp_room, '|'); ++i) {
-               extract_token(recipient, recps->recp_room, i,
+       /* If other rooms are specified in the To: field, drop them there too. */
+       /******* FIXME FIXME ADD CC AND BCC HERE *********/
+       if (recps_to != NULL)
+        if (recps_to->num_room > 0)
+         for (i=0; i<num_tokens(recps_to->recp_room, '|'); ++i) {
+               extract_token(recipient, recps_to->recp_room, i,
                                        '|', sizeof recipient);
                lprintf(CTDL_DEBUG, "Delivering to room <%s>\n", recipient);
                CtdlSaveMsgPointerInRoom(recipient, newmsgid, 0);
@@ -2248,10 +2263,11 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,     /* message to save */
        /* If this is private, local mail, make a copy in the
         * recipient's mailbox and bump the reference count.
         */
-       if (recps != NULL)
-        if (recps->num_local > 0)
-         for (i=0; i<num_tokens(recps->recp_local, '|'); ++i) {
-               extract_token(recipient, recps->recp_local, i,
+       /******* FIXME FIXME ADD CC AND BCC HERE *********/
+       if (recps_to != NULL)
+        if (recps_to->num_local > 0)
+         for (i=0; i<num_tokens(recps_to->recp_local, '|'); ++i) {
+               extract_token(recipient, recps_to->recp_local, i,
                                        '|', sizeof recipient);
                lprintf(CTDL_DEBUG, "Delivering private local mail to <%s>\n",
                        recipient);
@@ -2280,10 +2296,11 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,     /* message to save */
         * node.  We'll revisit this again in a year or so when everyone has
         * a network spool receiver that can handle the new style messages.
         */
-       if (recps != NULL)
-        if (recps->num_ignet > 0)
-         for (i=0; i<num_tokens(recps->recp_ignet, '|'); ++i) {
-               extract_token(recipient, recps->recp_ignet, i,
+       /******* FIXME FIXME ADD CC AND BCC HERE *********/
+       if (recps_to != NULL)
+        if (recps_to->num_ignet > 0)
+         for (i=0; i<num_tokens(recps_to->recp_ignet, '|'); ++i) {
+               extract_token(recipient, recps_to->recp_ignet, i,
                                '|', sizeof recipient);
 
                hold_R = msg->cm_fields['R'];
@@ -2326,24 +2343,43 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,     /* message to save */
        /* For internet mail, generate delivery instructions.
         * Yes, this is recursive.  Deal with it.  Infinite recursion does
         * not happen because the delivery instructions message does not
-        * contain a recipient.
+        * have any recipients.
         */
-       if (recps != NULL)
-        if (recps->num_internet > 0) {
+       if (is_internet_mail) {
                lprintf(CTDL_DEBUG, "Generating delivery instructions\n");
-               instr = malloc(SIZ * 2);
-               snprintf(instr, SIZ * 2,
+               instr = malloc(SIZ * 4);
+               snprintf(instr, SIZ * 4,
                        "Content-type: %s\n\nmsgid|%ld\nsubmitted|%ld\n"
                        "bounceto|%s@%s\n",
                        SPOOLMIME, newmsgid, (long)time(NULL),
                        msg->cm_fields['A'], msg->cm_fields['N']
                );
 
-               for (i=0; i<num_tokens(recps->recp_internet, '|'); ++i) {
-                       size_t tmp = strlen(instr);
-                       extract_token(recipient, recps->recp_internet, i, '|', sizeof recipient);
-                       snprintf(&instr[tmp], SIZ * 2 - tmp,
-                                "remote|%s|0||\n", recipient);
+               if (recps_to) if (strlen(recps_to->recp_internet) > 0) {
+                       for (i=0; i<num_tokens(recps_to->recp_internet, '|'); ++i) {
+                               tmp = strlen(instr);
+                               extract_token(recipient, recps_to->recp_internet, i, '|', sizeof recipient);
+                               snprintf(&instr[tmp], SIZ * 4 - tmp,
+                                       "remote|%s|0||\n", recipient);
+                       }
+               }
+
+               if (recps_cc) if (strlen(recps_cc->recp_internet) > 0) {
+                       for (i=0; i<num_tokens(recps_cc->recp_internet, '|'); ++i) {
+                               tmp = strlen(instr);
+                               extract_token(recipient, recps_cc->recp_internet, i, '|', sizeof recipient);
+                               snprintf(&instr[tmp], SIZ * 4 - tmp,
+                                       "remote|%s|0||\n", recipient);
+                       }
+               }
+
+               if (recps_bcc) if (strlen(recps_bcc->recp_internet) > 0) {
+                       for (i=0; i<num_tokens(recps_bcc->recp_internet, '|'); ++i) {
+                               tmp = strlen(instr);
+                               extract_token(recipient, recps_bcc->recp_internet, i, '|', sizeof recipient);
+                               snprintf(&instr[tmp], SIZ * 4 - tmp,
+                                       "remote|%s|0||\n", recipient);
+                       }
                }
 
                imsg = malloc(sizeof(struct CtdlMessage));
@@ -2353,7 +2389,7 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,       /* message to save */
                imsg->cm_format_type = FMT_RFC822;
                imsg->cm_fields['A'] = strdup("Citadel");
                imsg->cm_fields['M'] = instr;
-               CtdlSubmitMsg(imsg, NULL, SMTP_SPOOLOUT_ROOM);
+               CtdlSubmitMsg(imsg, NULL, NULL, NULL, SMTP_SPOOLOUT_ROOM);
                CtdlFreeMessage(imsg);
        }
 
@@ -2388,7 +2424,7 @@ void quickie_message(char *from, char *to, char *room, char *text,
        }
        msg->cm_fields['M'] = strdup(text);
 
-       CtdlSubmitMsg(msg, recp, room);
+       CtdlSubmitMsg(msg, recp, NULL, NULL, room);
        CtdlFreeMessage(msg);
        if (recp != NULL) free(recp);
 }
@@ -2808,6 +2844,8 @@ void cmd_ent0(char *entargs)
 {
        int post = 0;
        char recp[SIZ];
+       char cc[SIZ];
+       char bcc[SIZ];
        char masquerade_as[SIZ];
        int anon_flag = 0;
        int format_type = 0;
@@ -2816,7 +2854,9 @@ void cmd_ent0(char *entargs)
        int anonymous = 0;
        char errmsg[SIZ];
        int err = 0;
-       struct recptypes *valid = NULL;
+       struct recptypes *valid_to = NULL;
+       struct recptypes *valid_cc = NULL;
+       struct recptypes *valid_bcc = NULL;
        char subject[SIZ];
        int do_confirm = 0;
        long msgnum;
@@ -2829,6 +2869,8 @@ void cmd_ent0(char *entargs)
        format_type = extract_int(entargs, 3);
        extract_token(subject, entargs, 4, '|', sizeof subject);
        do_confirm = extract_int(entargs, 6);
+       extract_token(cc, entargs, 7, '|', sizeof cc);
+       extract_token(bcc, entargs, 8, '|', sizeof bcc);
 
        /* first check to make sure the request is valid. */
 
@@ -2866,37 +2908,64 @@ void cmd_ent0(char *entargs)
                        strcpy(recp, "sysop");
                }
 
-               valid = validate_recipients(recp);
-               if (valid->num_error > 0) {
+               valid_to = validate_recipients(recp);
+               if (valid_to->num_error > 0) {
                        cprintf("%d %s\n",
-                               ERROR + NO_SUCH_USER, valid->errormsg);
-                       free(valid);
+                               ERROR + NO_SUCH_USER, valid_to->errormsg);
+                       free(valid_to);
                        return;
                }
-               if (valid->num_internet > 0) {
+
+               valid_cc = validate_recipients(cc);
+               if (valid_cc->num_error > 0) {
+                       cprintf("%d %s\n",
+                               ERROR + NO_SUCH_USER, valid_cc->errormsg);
+                       free(valid_to);
+                       free(valid_cc);
+                       return;
+               }
+
+               valid_bcc = validate_recipients(bcc);
+               if (valid_bcc->num_error > 0) {
+                       cprintf("%d %s\n",
+                               ERROR + NO_SUCH_USER, valid_bcc->errormsg);
+                       free(valid_to);
+                       free(valid_cc);
+                       free(valid_bcc);
+                       return;
+               }
+
+               if (valid_to->num_internet + valid_cc->num_internet + valid_bcc->num_internet > 0) {
                        if (CtdlCheckInternetMailPermission(&CC->user)==0) {
                                cprintf("%d You do not have permission "
                                        "to send Internet mail.\n",
                                        ERROR + HIGHER_ACCESS_REQUIRED);
-                               free(valid);
+                               free(valid_to);
+                               free(valid_cc);
+                               free(valid_bcc);
                                return;
                        }
                }
 
-               if ( ( (valid->num_internet + valid->num_ignet) > 0)
+               if ( ( (valid_to->num_internet + valid_to->num_ignet + valid_cc->num_internet + valid_cc->num_ignet + valid_bcc->num_internet + valid_bcc->num_ignet) > 0)
                   && (CC->user.axlevel < 4) ) {
                        cprintf("%d Higher access required for network mail.\n",
                                ERROR + HIGHER_ACCESS_REQUIRED);
-                       free(valid);
+                       free(valid_to);
+                       free(valid_cc);
+                       free(valid_bcc);
                        return;
                }
        
-               if ((RESTRICT_INTERNET == 1) && (valid->num_internet > 0)
+               if ((RESTRICT_INTERNET == 1)
+                   && (valid_to->num_internet + valid_cc->num_internet + valid_bcc->num_internet > 0)
                    && ((CC->user.flags & US_INTERNET) == 0)
                    && (!CC->internal_pgm)) {
                        cprintf("%d You don't have access to Internet mail.\n",
                                ERROR + HIGHER_ACCESS_REQUIRED);
-                       free(valid);
+                       free(valid_to);
+                       free(valid_cc);
+                       free(valid_bcc);
                        return;
                }
 
@@ -2922,8 +2991,10 @@ void cmd_ent0(char *entargs)
         */
        if (post == 0) {
                cprintf("%d %s\n", CIT_OK,
-                       ((valid != NULL) ? valid->display_recp : "") );
-               free(valid);
+                       ((valid_to != NULL) ? valid_to->display_recp : "") );
+               free(valid_to);
+               free(valid_cc);
+               free(valid_bcc);
                return;
        }
 
@@ -2949,7 +3020,7 @@ void cmd_ent0(char *entargs)
                masquerade_as, subject, NULL);
 
        if (msg != NULL) {
-               msgnum = CtdlSubmitMsg(msg, valid, "");
+               msgnum = CtdlSubmitMsg(msg, valid_to, valid_cc, valid_bcc, "");
 
                if (do_confirm) {
                        cprintf("%ld\n", msgnum);
@@ -2970,7 +3041,9 @@ void cmd_ent0(char *entargs)
                CtdlFreeMessage(msg);
        }
        CC->fake_postname[0] = '\0';
-       free(valid);
+       free(valid_to);
+       free(valid_cc);
+       free(valid_bcc);
        return;
 }
 
@@ -3425,7 +3498,7 @@ void CtdlWriteObject(char *req_room,              /* Room to stuff it in */
                );
        }
        /* Now write the data */
-       CtdlSubmitMsg(msg, NULL, roomname);
+       CtdlSubmitMsg(msg, NULL, NULL, NULL, roomname);
        CtdlFreeMessage(msg);
 }
 
index 50d8b72f04a3af7537a28b3eaa05558d29d43607..d09cb6660dcaad60aba8563b9773d026aca21b72 100644 (file)
@@ -84,7 +84,8 @@ void cmd_msgp (char *cmdbuf);
 void cmd_opna (char *cmdbuf);
 long send_message (struct CtdlMessage *);
 void loadtroom (void);
-long CtdlSubmitMsg(struct CtdlMessage *, struct recptypes *, char *);
+long CtdlSubmitMsg(struct CtdlMessage *, struct recptypes *,
+               struct recptypes *, struct recptypes *, char *);
 void quickie_message (char *, char *, char *, char *, int, char *);
 void cmd_ent0 (char *entargs);
 void cmd_dele (char *delstr);
index fbc5ec510279dcf2ef599ed0516831c7b0fcaa8f..ec8be83443260ce8454f3da847cb3cb73de7bf14 100644 (file)
@@ -323,7 +323,7 @@ void ical_send_a_reply(icalcomponent *request, char *action) {
        
                if (msg != NULL) {
                        valid = validate_recipients(organizer_string);
-                       CtdlSubmitMsg(msg, valid, "");
+                       CtdlSubmitMsg(msg, valid, NULL, NULL, "");
                        CtdlFreeMessage(msg);
                }
        }
@@ -698,7 +698,7 @@ int ical_update_my_calendar_with_reply(icalcomponent *cal) {
        
                if (msg != NULL) {
                        CIT_ICAL->avoid_sending_invitations = 1;
-                       CtdlSubmitMsg(msg, NULL, roomname);
+                       CtdlSubmitMsg(msg, NULL, NULL, NULL, roomname);
                        CtdlFreeMessage(msg);
                        CIT_ICAL->avoid_sending_invitations = 0;
                }
@@ -1589,7 +1589,7 @@ void ical_send_out_invitations(icalcomponent *cal) {
        
                if (msg != NULL) {
                        valid = validate_recipients(attendees_string);
-                       CtdlSubmitMsg(msg, valid, "");
+                       CtdlSubmitMsg(msg, valid, NULL, NULL, "");
                        CtdlFreeMessage(msg);
                }
        }
index b323dab7a5590a46f2a9efb93afc0fe6bcc11373..8b4e28c78586539e8c3b447a777c3358354e9986 100644 (file)
@@ -634,7 +634,7 @@ int send_instant_message(char *lun, char *x_user, char *x_msg)
                 * creating the room if necessary.
                 */
                create_room(PAGELOGROOM, 4, "", 0, 1, 0, VIEW_BBS);
-               msgnum = CtdlSubmitMsg(logmsg, NULL, PAGELOGROOM);
+               msgnum = CtdlSubmitMsg(logmsg, NULL, NULL, NULL, PAGELOGROOM);
 
                /* Now save a copy in the global log room, if configured */
                if (strlen(config.c_logpages) > 0) {
index 7efe6c62add4c55a2697e25ce110c0e557a99f49..668ed2964a30958c0af986b066cb4096820e79eb 100644 (file)
@@ -470,7 +470,7 @@ void network_spool_msg(long msgnum, void *userdata) {
                                msg->cm_fields['R'] = strdup(nptr->name);
 
                                valid = validate_recipients(nptr->name);
-                               CtdlSubmitMsg(msg, valid, "");
+                               CtdlSubmitMsg(msg, valid, NULL, NULL, "");
                                free(valid);
 
                        }
@@ -573,7 +573,7 @@ void network_spool_msg(long msgnum, void *userdata) {
                                        msg->cm_fields['R'] = strdup(nptr->name);
        
                                        valid = validate_recipients(nptr->name);
-                                       CtdlSubmitMsg(msg, valid, "");
+                                       CtdlSubmitMsg(msg, valid, NULL, NULL, "");
                                        free(valid);
                                }
                        
@@ -748,7 +748,7 @@ void network_deliver_digest(struct SpoolControl *sc) {
        fclose(sc->digestfp);
        sc->digestfp = NULL;
 
-       msgnum = CtdlSubmitMsg(msg, NULL, SMTP_SPOOLOUT_ROOM);
+       msgnum = CtdlSubmitMsg(msg, NULL, NULL, NULL, SMTP_SPOOLOUT_ROOM);
        CtdlFreeMessage(msg);
 
        /* Now generate the delivery instructions */
@@ -794,7 +794,7 @@ void network_deliver_digest(struct SpoolControl *sc) {
        imsg->cm_fields['M'] = instr;
 
        /* Save delivery instructions in spoolout room */
-       CtdlSubmitMsg(imsg, NULL, SMTP_SPOOLOUT_ROOM);
+       CtdlSubmitMsg(imsg, NULL, NULL, NULL, SMTP_SPOOLOUT_ROOM);
        CtdlFreeMessage(imsg);
 }
 
@@ -1233,7 +1233,7 @@ void network_bounce(struct CtdlMessage *msg, char *reason) {
        if ( (valid == NULL) && (strlen(force_room) == 0) ) {
                strcpy(force_room, config.c_aideroom);
        }
-       CtdlSubmitMsg(msg, valid, force_room);
+       CtdlSubmitMsg(msg, valid, NULL, NULL, force_room);
 
        /* Clean up */
        if (valid != NULL) free(valid);
@@ -1413,7 +1413,7 @@ void network_process_buffer(char *buffer, long size) {
        /* save the message into a room */
        if (PerformNetprocHooks(msg, target_room) == 0) {
                msg->cm_flags = CM_SKIP_HOOKS;
-               CtdlSubmitMsg(msg, recp, target_room);
+               CtdlSubmitMsg(msg, recp, NULL, NULL, target_room);
        }
        CtdlFreeMessage(msg);
        free(recp);
index 68f33702c6c23b1bb13451c8be5611c05f3d5423..c5da74dd3e8352964a3a31fcf7b394f4d5e0e945 100644 (file)
@@ -756,7 +756,7 @@ void smtp_data(void) {
        }
        
        else {                  /* Ok, we'll accept this message. */
-               msgnum = CtdlSubmitMsg(msg, valid, "");
+               msgnum = CtdlSubmitMsg(msg, valid, NULL, NULL, "");
                if (msgnum > 0L) {
                        sprintf(result, "250 2.0.0 Message accepted.\r\n");
                }
@@ -1309,14 +1309,14 @@ void smtp_do_bounce(char *instr) {
                valid = validate_recipients(bounceto);
                if (valid != NULL) {
                        if (valid->num_error == 0) {
-                               CtdlSubmitMsg(bmsg, valid, "");
+                               CtdlSubmitMsg(bmsg, valid, NULL, NULL, "");
                                successful_bounce = 1;
                        }
                }
 
                /* If not, post it in the Aide> room */
                if (successful_bounce == 0) {
-                       CtdlSubmitMsg(bmsg, NULL, config.c_aideroom);
+                       CtdlSubmitMsg(bmsg, NULL, NULL, NULL, config.c_aideroom);
                }
 
                /* Free up the memory we used */
@@ -1550,7 +1550,7 @@ void smtp_do_procmsg(long msgnum, void *userdata) {
                        "attempted|%ld\n"
                        "retry|%ld\n",
                        SPOOLMIME, instr, (long)time(NULL), (long)retry );
-               CtdlSubmitMsg(msg, NULL, SMTP_SPOOLOUT_ROOM);
+               CtdlSubmitMsg(msg, NULL, NULL, NULL, SMTP_SPOOLOUT_ROOM);
                CtdlFreeMessage(msg);
        }
 
index 25b561d9cd1d324cd725bc146fab8c8660cf1533..fd197c16e8b9c65be10d3fbbfd27127e95b4a4c7 100644 (file)
@@ -811,7 +811,7 @@ void vcard_purge(struct ctdluser *usbuf) {
 
        msg->cm_fields['S'] = strdup("CANCEL");
 
-        CtdlSubmitMsg(msg, NULL, ADDRESS_BOOK_ROOM);
+        CtdlSubmitMsg(msg, NULL, NULL, NULL, ADDRESS_BOOK_ROOM);
         CtdlFreeMessage(msg);
 }
 
index 5484129ce57e905e55fad7300eb27ac708fc7cc2..2552f6bb4a6d4b0208b4d131e582f26169da3c75 100644 (file)
@@ -458,6 +458,6 @@ struct ser_ret {
 /*               **********                    Important fields */
 /*                         ***************     Semi-important fields */
 /*                                        *    Message text (MUST be last) */
-#define FORDER "IPTAFONHRDBCEGJKLQSVWXYZUM"
+#define FORDER "IPTAFONHRDBCEGJKLQSVWXZYUM"
 
 #endif /* SERVER_H */
index b85b3c74fb7822463b83283490945f5b5f8e9eb2..cfa5838f61ed19cd07c0e46e74fcf1bf95f82433 100644 (file)
@@ -254,7 +254,7 @@ E   Exclusive ID    A persistent alphanumeric Message ID used for
                        message should be dropped.
 F      rFc822 address  For Internet mail, this is the delivery address of the
                        message author.
-H      HumanNodeName   Human-readable name of system message originated on.
+H      Human node name Human-readable name of system message originated on.
 I      Original ID     A 32-bit integer containing the message ID on the
                        system the message *originated* on.
 M      Message Text    Normal ASCII, newlines seperated by CR's or LF's,
@@ -276,12 +276,12 @@ S       Special field   Only meaningful for messages being spooled over a
                        -> "S" followed by "CANCEL" means that this message
                           should be deleted from the local message base once
                           it has been replicated to all network systems.
-T      Date/Time       A 32-bit integer containing the date and time of
+T      date/Time       A 32-bit integer containing the date and time of
                         the message in standard UNIX format (the number
                         of seconds since January 1, 1970 GMT).
-U       Subject         Optional.  Developers may choose whether they wish to
-                        generate or display subject fields.  Citadel does
-                        not generate them, but it does print them when found.
+U       sUbject         Optional.  Developers may choose whether they wish to
+                        generate or display subject fields.
+Y      carbon copY     Optional, and only in Mail messages.
 0      Error           This field is typically never found in a message on
                        disk or in transit.  Message scanning modules are
                        expected to fill in this field when rejecting a message
index fac6a6bbe8f65926c1134ee1ce55edf7eb31278b..9b6c11bcb0a032037944952244dcc3ea6b0c1b6c 100644 (file)
@@ -800,9 +800,9 @@ perform this operation at the beginning of an "enter message" command
 in vain that will not be permitted to be saved.  If it is set to 2, the
 server will accept an "apparent" post name if the user is privileged enough.
 This post name is arg 5.
-  1  -  Recipient.  This argument is utilized only for private mail messages.
-It is ignored for public messages.  It contains, of course, the name of the
-recipient of the message.
+  1  -  Recipient (To: field).  This argument is utilized only for private
+mail.  It is ignored for public messages.  It contains, of course, the name
+of the recipient(s) of the message.
   2  -  Anonymous flag.  This argument is ignored unless the room allows
 anonymous messages.  In such rooms, this flag may be set to 1 to flag a
 message as anonymous, otherwise 0 for a normal message.
@@ -816,6 +816,12 @@ This is an Aide only command.
 you set this to nonzero, ENT0 will reply with a confirmation message after
 you submit the message text.  The reply code for the ENT0 command will be
 START_CHAT_MODE instead of SEND_LISTING.
+  7  -  Recipient (Cc: field).  This argument is utilized only for private
+mail.  It is ignored for public messages.  It contains, of course, the name
+of the recipient(s) of the message.
+  8  -  Recipient (Bcc: field).  This argument is utilized only for private
+mail.  It is ignored for public messages.  It contains, of course, the name
+of the recipient(s) of the message.
 
  Possible result codes:
   OK  -  The request is valid.  (Client did not set the "post" flag, so the