* CC: support for message creation, and IMAP. Not tested.
authorArt Cancro <ajc@citadel.org>
Fri, 16 Sep 2005 20:40:44 +0000 (20:40 +0000)
committerArt Cancro <ajc@citadel.org>
Fri, 16 Sep 2005 20:40:44 +0000 (20:40 +0000)
citadel/ChangeLog
citadel/imap_fetch.c
citadel/imap_search.c
citadel/msgbase.c
citadel/msgbase.h
citadel/serv_calendar.c

index e9c10de5e9e91276d177e7dca009c481789a731a..cd103ce8ce8477052eae9b8d269817ac8f073dc8 100644 (file)
@@ -1,4 +1,7 @@
 $Log$
+Revision 655.7  2005/09/16 20:40:44  ajc
+* CC: support for message creation, and IMAP.  Not tested.
+
 Revision 655.6  2005/09/16 20:21:38  ajc
 * CC: and BCC: delivery are working (tested using message submittal
   from WebCit) -- still missing the insertion of Y (CC) header field, and
@@ -7132,3 +7135,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 3acfe7c93248228ea36e8f2461cb15aad57a51ab..e601645a23d36b67d46ba44f2bb620a8c03be000 100644 (file)
@@ -457,10 +457,16 @@ void imap_fetch_envelope(struct CtdlMessage *msg) {
        /* To */
        imap_output_envelope_addr(msg->cm_fields['R']);
 
-       /* Cc */
-       fieldptr = rfc822_fetch_field(msg->cm_fields['M'], "Cc");
-       imap_output_envelope_addr(fieldptr);
-       if (fieldptr != NULL) free(fieldptr);
+       /* Cc (we do it this way because there might be a legacy non-Citadel Cc: field present) */
+       fieldptr = msg->cm_fields['Y'];
+       if (fieldptr != NULL) {
+               imap_output_envelope_addr(fieldptr);
+       }
+       else {
+               fieldptr = rfc822_fetch_field(msg->cm_fields['M'], "Cc");
+               imap_output_envelope_addr(fieldptr);
+               if (fieldptr != NULL) free(fieldptr);
+       }
 
        /* Bcc */
        fieldptr = rfc822_fetch_field(msg->cm_fields['M'], "Bcc");
index 50bf6dd785fe3f1f0aab9d082697810e497c3db8..dbb0b89d29e38710cd02b63e1eb72dd70a39ecb3 100644 (file)
@@ -151,12 +151,20 @@ int imap_do_search_msg(int seq, struct CtdlMessage *supplied_msg,
                        msg = CtdlFetchMessage(IMAP->msgids[seq-1], 1);
                        need_to_free_msg = 1;
                }
-               fieldptr = rfc822_fetch_field(msg->cm_fields['M'], "Cc");
+               fieldptr = msg->cm_fields['Y'];
                if (fieldptr != NULL) {
                        if (bmstrcasestr(fieldptr, itemlist[pos+1])) {
                                match = 1;
                        }
-                       free(fieldptr);
+               }
+               else {
+                       fieldptr = rfc822_fetch_field(msg->cm_fields['M'], "Cc");
+                       if (fieldptr != NULL) {
+                               if (bmstrcasestr(fieldptr, itemlist[pos+1])) {
+                                       match = 1;
+                               }
+                               free(fieldptr);
+                       }
                }
                pos += 2;
        }
index fc2be7f056b28205d4fe9c8c013e6b3e4c546b02..50aeaa1ae5766316e416e66933df84867b382526 100644 (file)
@@ -2501,6 +2501,7 @@ char *CtdlReadMessageBody(char *terminator,       /* token signalling EOT */
 struct CtdlMessage *CtdlMakeMessage(
        struct ctdluser *author,        /* author's user structure */
        char *recipient,                /* NULL if it's not mail */
+       char *recp_cc,                  /* NULL if it's not mail */
        char *room,                     /* room where it's going */
        int type,                       /* see MES_ types in header file */
        int format_type,                /* variformat, plain text, MIME... */
@@ -2522,6 +2523,7 @@ struct CtdlMessage *CtdlMakeMessage(
        strcpy(dest_node, "");
 
        striplt(recipient);
+       striplt(recp_cc);
 
        snprintf(buf, sizeof buf, "cit%ld", author->usernum);   /* Path */
        msg->cm_fields['P'] = strdup(buf);
@@ -2547,6 +2549,9 @@ struct CtdlMessage *CtdlMakeMessage(
        if (recipient[0] != 0) {
                msg->cm_fields['R'] = strdup(recipient);
        }
+       if (recp_cc[0] != 0) {
+               msg->cm_fields['Y'] = strdup(recp_cc);
+       }
        if (dest_node[0] != 0) {
                msg->cm_fields['D'] = strdup(dest_node);
        }
@@ -3005,7 +3010,7 @@ void cmd_ent0(char *entargs)
                cprintf("%d send message\n", SEND_LISTING);
        }
 
-       msg = CtdlMakeMessage(&CC->user, recp,
+       msg = CtdlMakeMessage(&CC->user, recp, cc,
                CC->room.QRname, anonymous, format_type,
                masquerade_as, subject, NULL);
 
index 50d8b72f04a3af7537a28b3eaa05558d29d43607..6269f6c3391bae1ea5e467fc1c07578c426e0b22 100644 (file)
@@ -140,6 +140,7 @@ struct recptypes *validate_recipients(char *recipients);
 struct CtdlMessage *CtdlMakeMessage(
         struct ctdluser *author,        /* author's user structure */
         char *recipient,                /* NULL if it's not mail */
+        char *recp_cc,                 /* NULL if it's not mail */
         char *room,                     /* room where it's going */
         int type,                       /* see MES_ types in header file */
         int format_type,                /* variformat, plain text, MIME... */
index fbc5ec510279dcf2ef599ed0516831c7b0fcaa8f..9baed0f7502a88a8600ba08bda51862228d2fe78 100644 (file)
@@ -315,7 +315,9 @@ void ical_send_a_reply(icalcomponent *request, char *action) {
                        serialized_reply
                );
 
-               msg = CtdlMakeMessage(&CC->user, organizer_string,
+               msg = CtdlMakeMessage(&CC->user,
+                       organizer_string,       /* to */
+                       "",                     /* cc */
                        CC->room.QRname, 0, FMT_RFC822,
                        "",
                        summary_string,         /* Use summary for subject */
@@ -689,6 +691,7 @@ int ical_update_my_calendar_with_reply(icalcomponent *cal) {
                );
 
                msg = CtdlMakeMessage(&CC->user,
+                       "",                     /* No recipient */
                        "",                     /* No recipient */
                        roomname,
                        0, FMT_RFC822,
@@ -1581,6 +1584,7 @@ void ical_send_out_invitations(icalcomponent *cal) {
                );
 
                msg = CtdlMakeMessage(&CC->user,
+                       "",                     /* No single recipient here */
                        "",                     /* No single recipient here */
                        CC->room.QRname, 0, FMT_RFC822,
                        "",