{ "folder_format", DT_STR, R_NONE, UL &FolderFormat, UL "%N %F %2l %-8.8u %-8.8g %8s %d %f" },
{ "followup_to", DT_BOOL, R_NONE, OPTFOLLOWUPTO, 1 },
{ "force_name", DT_BOOL, R_NONE, OPTFORCENAME, 0 },
+ { "forward_attachment", DT_BOOL, R_NONE, OPTFORWATTACH, 0 },
+ { "forw_attachment", DT_SYN, R_NONE, UL "forward_attachment", 0 },
{ "forward_decode", DT_BOOL, R_NONE, OPTFORWDECODE, 1 },
{ "forw_decode", DT_SYN, R_NONE, UL "forward_decode", 0 },
{ "forward_weed", DT_BOOL, R_NONE, OPTFORWWEEDHEADER, 1 },
OPTFCCATTACH,
OPTFOLLOWUPTO,
OPTFORCENAME,
+ OPTFORWATTACH,
OPTFORWDECODE,
OPTFORWWEEDHEADER,
OPTFORWQUOTE,
}
else
{
- mutt_mktemp (file);
+ BODY *b = hdr->content;
+ file[0] = 0;
+ if (b->filename)
+ strfcpy (file, b->filename, sizeof (file));
+ mutt_adv_mktemp (file, sizeof(file));
if (mutt_save_attachment (msg->fp, hdr->content, file, 0, NULL) == -1)
{
mutt_free_envelope (&newhdr->env);
FREE (&newhdr->content->subtype);
FREE (&newhdr->content->xtype);
+ FREE (&newhdr->content->description);
newhdr->content->type = hdr->content->type;
newhdr->content->xtype = safe_strdup (hdr->content->xtype);
newhdr->content->subtype = safe_strdup (hdr->content->subtype);
+ newhdr->content->description = safe_strdup (hdr->content->description);
for (par = hdr->content->parameter; par; par = par->next)
mutt_set_parameter (par->attribute, par->value, &newhdr->content->parameter);
ctx = mx_open_mailbox (tempfile, M_QUIET, NULL);
hn = ctx->hdrs[0];
}
-
- ci_send_message (op, NULL, NULL, ctx, hn);
+
+ if (op == SENDFORWARD && option (OPTFORWATTACH))
+ {
+ HEADER *newhdr = mutt_new_header();
+ mutt_prepare_edit_message (ctx, newhdr, hn);
+ mutt_free_envelope (&newhdr->env);
+ newhdr->env = mutt_new_envelope();
+ ci_send_message (0, newhdr, NULL, ctx, NULL);
+ }
+ else
+ ci_send_message (op, NULL, NULL, ctx, hn);
if (hn->replied && !hdr->replied)
mutt_set_flag (Context, hdr, M_REPLIED, 1);