1 A patch that allows multiple FCC separated by commas, written by Omen Wild
3 Original website: http://www.mandarb.com/mutt/
4 Bug asking for the inclusion: 586454
9 void mutt_update_num_postponed (void);
10 int mutt_wait_filter (pid_t);
11 int mutt_which_case (const char *);
12 +int mutt_write_multiple_fcc (const char *path, HEADER *hdr, const char *msgid, int, char *);
13 int mutt_write_fcc (const char *path, HEADER *hdr, const char *msgid, int, char *);
14 int mutt_write_mime_body (BODY *, FILE *);
15 int mutt_write_mime_header (BODY *, FILE *);
19 * message was first postponed.
21 msg->received = time (NULL);
22 - if (mutt_write_fcc (fcc, msg, NULL, 0, NULL) == -1)
23 + if (mutt_write_multiple_fcc (fcc, msg, NULL, 0, NULL) == -1)
26 * Error writing FCC, we should abort sending.
29 @@ -2664,6 +2664,36 @@
33 +/* Handle a Fcc with multiple, comma separated entries. */
34 +int mutt_write_multiple_fcc (const char *path, HEADER *hdr, const char *msgid, int post, char *fcc) {
35 + char fcc_tok[_POSIX_PATH_MAX];
36 + char fcc_expanded[_POSIX_PATH_MAX];
40 + strfcpy(fcc_tok, path, _POSIX_PATH_MAX);
42 + tok = strtok(fcc_tok, ",");
43 + dprint(1, (debugfile, "Fcc: initial mailbox = '%s'\n", tok));
44 + /* mutt_expand_path already called above for the first token */
45 + if((status = mutt_write_fcc (tok, hdr, NULL, 0, NULL)) != 0)
48 + while((tok = strtok(NULL, ",")) != NULL) {
50 + /* Only call mutt_expand_path iff tok has some data */
51 + dprint(1, (debugfile, "Fcc: additional mailbox token = '%s'\n", tok));
52 + strfcpy(fcc_expanded, tok, sizeof(fcc_expanded));
53 + mutt_expand_path(fcc_expanded, sizeof(fcc_expanded));
54 + dprint(1, (debugfile, " Additional mailbox expanded = '%s'\n", fcc_expanded));
55 + if((status = mutt_write_fcc (fcc_expanded, hdr, NULL, 0, NULL)) != 0)
63 int mutt_write_fcc (const char *path, HEADER *hdr, const char *msgid, int post, char *fcc)