From 844e28cd678c203f26a813ed288edd65e27e5a4e Mon Sep 17 00:00:00 2001 From: Antonio Radici Date: Fri, 29 Apr 2011 18:06:13 +0100 Subject: [PATCH] multiple-fccs: added a patch that allows multiple FCC separated by commas, written by Omen Wild (Closes: 586454) --- debian/changelog | 2 + debian/patches/mutt-patched/multiple-fcc | 65 ++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 68 insertions(+) create mode 100644 debian/patches/mutt-patched/multiple-fcc diff --git a/debian/changelog b/debian/changelog index 34d49e0..c332e66 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ mutt (1.5.21-5) unstable; urgency=low (Closes: 619822) + sidebar-{dotted,sorted}: documented the options that those two patches are introducing; documentation submitted by Julien Valroff (Closes: 603186) + + multiple-fccs: added a patch that allows multiple FCC separated by commas, + written by Omen Wild (Closes: 586454) -- Antonio Radici Fri, 29 Apr 2011 17:24:49 +0100 diff --git a/debian/patches/mutt-patched/multiple-fcc b/debian/patches/mutt-patched/multiple-fcc new file mode 100644 index 0000000..ca17d54 --- /dev/null +++ b/debian/patches/mutt-patched/multiple-fcc @@ -0,0 +1,65 @@ +A patch that allows multiple FCC separated by commas, written by Omen Wild + +Original website: http://www.mandarb.com/mutt/ +Bug asking for the inclusion: 586454 + +--- a/protos.h ++++ b/protos.h +@@ -362,6 +362,7 @@ + void mutt_update_num_postponed (void); + int mutt_wait_filter (pid_t); + int mutt_which_case (const char *); ++int mutt_write_multiple_fcc (const char *path, HEADER *hdr, const char *msgid, int, char *); + int mutt_write_fcc (const char *path, HEADER *hdr, const char *msgid, int, char *); + int mutt_write_mime_body (BODY *, FILE *); + int mutt_write_mime_header (BODY *, FILE *); +--- a/send.c ++++ b/send.c +@@ -1735,7 +1735,7 @@ + * message was first postponed. + */ + msg->received = time (NULL); +- if (mutt_write_fcc (fcc, msg, NULL, 0, NULL) == -1) ++ if (mutt_write_multiple_fcc (fcc, msg, NULL, 0, NULL) == -1) + { + /* + * Error writing FCC, we should abort sending. +--- a/sendlib.c ++++ b/sendlib.c +@@ -2664,6 +2664,36 @@ + } + } + ++/* Handle a Fcc with multiple, comma separated entries. */ ++int mutt_write_multiple_fcc (const char *path, HEADER *hdr, const char *msgid, int post, char *fcc) { ++ char fcc_tok[_POSIX_PATH_MAX]; ++ char fcc_expanded[_POSIX_PATH_MAX]; ++ char *tok = NULL; ++ int status; ++ ++ strfcpy(fcc_tok, path, _POSIX_PATH_MAX); ++ ++ tok = strtok(fcc_tok, ","); ++ dprint(1, (debugfile, "Fcc: initial mailbox = '%s'\n", tok)); ++ /* mutt_expand_path already called above for the first token */ ++ if((status = mutt_write_fcc (tok, hdr, NULL, 0, NULL)) != 0) ++ return status; ++ ++ while((tok = strtok(NULL, ",")) != NULL) { ++ if(*tok) { ++ /* Only call mutt_expand_path iff tok has some data */ ++ dprint(1, (debugfile, "Fcc: additional mailbox token = '%s'\n", tok)); ++ strfcpy(fcc_expanded, tok, sizeof(fcc_expanded)); ++ mutt_expand_path(fcc_expanded, sizeof(fcc_expanded)); ++ dprint(1, (debugfile, " Additional mailbox expanded = '%s'\n", fcc_expanded)); ++ if((status = mutt_write_fcc (fcc_expanded, hdr, NULL, 0, NULL)) != 0) ++ return status; ++ } ++ } ++ ++ return 0; ++} ++ + int mutt_write_fcc (const char *path, HEADER *hdr, const char *msgid, int post, char *fcc) + { + CONTEXT f; diff --git a/debian/patches/series b/debian/patches/series index 220ff07..a767d62 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -54,6 +54,7 @@ mutt.org mutt-patched/sidebar mutt-patched/sidebar-dotted mutt-patched/sidebar-sorted +mutt-patched/multiple-fcc # not applying cleanly at the moment #mutt-patched/nntp -- 2.43.0