oldhdrdate = option(OPTUSEHEADERDATE);
set_option(OPTUSEHEADERDATE);
- if (mutt_write_fcc (NONULL (fname), msg, NULL, 1) < 0)
+ if (mutt_write_fcc (NONULL (fname), msg, NULL, 1, NULL) < 0)
msg->content = mutt_remove_multipart (msg->content);
else
mutt_message _("Message written.");
* hdr envelope/attachment info for recalled message
* cur if message was a reply, `cur' is set to the message which
* `hdr' is in reply to
+ * fcc fcc for the recalled message
+ * fcclen max length of fcc
*
* return vals:
* -1 error/no messages
* 0 normal exit
* SENDREPLY recalled message is a reply
*/
-int mutt_get_postponed (CONTEXT *ctx, HEADER *hdr, HEADER **cur)
+int mutt_get_postponed (CONTEXT *ctx, HEADER *hdr, HEADER **cur, char *fcc, size_t fcclen)
{
HEADER *h;
int code = SENDPOSTPONED;
if (*cur)
code |= SENDREPLY;
}
+ else if (strncasecmp ("X-Mutt-Fcc:", tmp->data, 11) == 0)
+ {
+ p = tmp->data + 11;
+ SKIPWS (p);
+ strfcpy (fcc, p, fcclen);
+ mutt_pretty_mailbox (fcc);
+
+ /* remove the X-Mutt-Fcc: header field */
+ next = tmp->next;
+ if (last)
+ last->next = tmp->next;
+ else
+ hdr->env->userhdrs = tmp->next;
+ tmp->next = NULL;
+ mutt_free_list (&tmp);
+ tmp = next;
+ }
int mutt_enter_string (unsigned char *, size_t, int, int, int);
int mutt_get_field (char *, char *, size_t, int);
int mutt_get_password (char *, char *, size_t);
-int mutt_get_postponed (CONTEXT *, HEADER *, HEADER **);
+int mutt_get_postponed (CONTEXT *, HEADER *, HEADER **, char *, size_t);
int mutt_get_tmp_attachment (BODY *);
int mutt_index_menu (void);
int mutt_invoke_sendmail (ADDRESS *, ADDRESS *, ADDRESS *, const char *, int);
int mutt_view_attachment (FILE*, BODY *, int);
int mutt_wait_filter (pid_t);
int mutt_which_case (const char *);
-int mutt_write_fcc (const char *path, HEADER *hdr, const char *msgid, int);
+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 *);
int mutt_write_rfc822_header (FILE *, ENVELOPE *, BODY *, int);
}
else if (flags == SENDPOSTPONED)
{
- if ((flags = mutt_get_postponed (ctx, msg, &cur)) < 0)
+ if ((flags = mutt_get_postponed (ctx, msg, &cur, fcc, sizeof (fcc))) < 0)
goto cleanup;
}
/* postpone the message until later. */
if (msg->content->next)
msg->content = mutt_make_multipart (msg->content);
- if (!Postponed || mutt_write_fcc (NONULL (Postponed), msg, (cur && (flags & SENDREPLY)) ? cur->env->message_id : NULL, 1) < 0)
+ if (!Postponed || mutt_write_fcc (NONULL (Postponed), msg, (cur && (flags & SENDREPLY)) ? cur->env->message_id : NULL, 1, fcc) < 0)
{
msg->content = mutt_remove_multipart (msg->content);
goto main_loop;
full_fcc:
#endif /* _PGPPATH */
if (msg->content)
- mutt_write_fcc (fcc, msg, NULL, 0);
+ mutt_write_fcc (fcc, msg, NULL, 0, NULL);
msg->content = tmpbody;
#ifdef _PGPPATH
return (top);
}
-int mutt_write_fcc (const char *path, HEADER *hdr, const char *msgid, int post)
+int mutt_write_fcc (const char *path, HEADER *hdr, const char *msgid, int post, char *fcc)
{
CONTEXT f;
MESSAGE *msg;
*/
if (post && msgid)
fprintf (msg->fp, "X-Mutt-References: %s\n", msgid);
+
+ /* (postponment) save the Fcc: using a special X-Mutt- header so that
+ * it can be picked up when the message is recalled
+ */
+ if (post && fcc)
+ fprintf (msg->fp, "X-Mutt-Fcc: %s\n", fcc);
fprintf (msg->fp, "Status: RO\n");