From: Art Cancro Date: Fri, 16 Sep 2005 20:40:44 +0000 (+0000) Subject: * CC: support for message creation, and IMAP. Not tested. X-Git-Tag: v7.86~4646 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=7870ec6c19e8541016a25ffd4e4aeaf1e88cfc63 * CC: support for message creation, and IMAP. Not tested. --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index e9c10de5e..cd103ce8c 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -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 Fri Jul 10 1998 Art Cancro * Initial CVS import + diff --git a/citadel/imap_fetch.c b/citadel/imap_fetch.c index 3acfe7c93..e601645a2 100644 --- a/citadel/imap_fetch.c +++ b/citadel/imap_fetch.c @@ -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"); diff --git a/citadel/imap_search.c b/citadel/imap_search.c index 50bf6dd78..dbb0b89d2 100644 --- a/citadel/imap_search.c +++ b/citadel/imap_search.c @@ -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; } diff --git a/citadel/msgbase.c b/citadel/msgbase.c index fc2be7f05..50aeaa1ae 100644 --- a/citadel/msgbase.c +++ b/citadel/msgbase.c @@ -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); diff --git a/citadel/msgbase.h b/citadel/msgbase.h index 50d8b72f0..6269f6c33 100644 --- a/citadel/msgbase.h +++ b/citadel/msgbase.h @@ -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... */ diff --git a/citadel/serv_calendar.c b/citadel/serv_calendar.c index fbc5ec510..9baed0f75 100644 --- a/citadel/serv_calendar.c +++ b/citadel/serv_calendar.c @@ -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, "",