Attach a reply.
951{
952 bool mime_reply_any = false;
953
954 short nattach = 0;
956 struct Email *e_parent = NULL;
957 FILE *fp_parent = NULL;
958 struct Email *e_tmp = NULL;
959 FILE *fp_tmp = NULL;
960 struct Buffer *tmpbody = NULL;
962
964
967 else
969
971 {
974 if (parent)
975 {
977 fp_parent = parent->
fp;
978 }
979 else
980 {
981 e_parent = e;
983 }
984 }
985
987 {
991 goto cleanup;
993 mime_reply_any = true;
994 }
995 else if (nattach == 1)
996 {
997 mime_reply_any = true;
998 }
999
1002
1004 e_parent ? e_parent : (b ? b->
email : NULL),
1005 flags) == -1)
1006 {
1007 goto cleanup;
1008 }
1009
1013 if (!fp_tmp)
1014 {
1016 goto cleanup;
1017 }
1018
1019 if (e_parent)
1020 {
1022
1023 struct State state = { 0 };
1025
1027 if (c_text_flowed)
1028 {
1030 }
1031 else
1032 {
1035 setlocale(LC_TIME,
NONULL(c_attribution_locale));
1038 setlocale(LC_TIME, "");
1039 }
1040
1043
1045 if (c_weed)
1047
1049 if (c_header)
1051
1052 if (b)
1053 {
1055 {
1059 }
1060 else
1061 {
1063 }
1064 }
1065 else
1066 {
1067 for (
short i = 0; i < actx->
idxlen; i++)
1068 {
1070 {
1074 }
1075 }
1076 }
1077
1079
1081 {
1082 goto cleanup;
1083 }
1084 }
1085 else
1086 {
1087 if (b)
1088 {
1090 }
1091 else
1092 {
1093 for (
short i = 0; i < actx->
idxlen; i++)
1094 {
1097 }
1098 }
1099 }
1100
1102
1105 {
1107 }
1108 e_tmp = NULL;
1109
1110cleanup:
1111 if (fp_tmp)
1112 {
1115 }
1120}
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
#define ARRAY_FREE(head)
Release all memory.
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
const struct Expando * cs_subset_expando(const struct ConfigSubset *sub, const char *name)
Get an Expando config item by name.
struct Email * email_new(void)
Create a new Email.
void email_free(struct Email **ptr)
Free an Email.
struct Envelope * mutt_env_new(void)
Create a new Envelope.
void mutt_file_unlink(const char *s)
Delete a file, carefully.
#define mutt_file_fclose(FP)
#define mutt_file_fopen(PATH, MODE)
void mutt_set_flag(struct Mailbox *m, struct Email *e, enum MessageType flag, bool bf, bool upd_mbox)
Set a flag on an email.
bool OptNewsSend
(pseudo) used to change behavior when posting
bool mutt_can_decode(struct Body *b)
Will decoding the attachment produce any output.
int mutt_body_handler(struct Body *b, struct State *state)
Handler for the Body of an email.
int mutt_make_string(struct Buffer *buf, size_t max_cols, const struct Expando *exp, struct Mailbox *m, int inpgr, struct Email *e, MuttFormatFlags flags, const char *progress)
Create formatted strings using mailbox expandos.
#define STATE_WEED
Weed headers even when not in display mode.
#define state_putc(STATE, STR)
#define STATE_CHARCONV
Do character set conversions.
@ MUTT_REPLIED
Messages that have been replied to.
int mutt_body_copy(FILE *fp, struct Body **b_dst, struct Body *b_src)
Create a send-mode duplicate from a receive-mode body.
QuadOption
Possible values for a quad-option.
@ MUTT_ABORT
User aborted the question (with Ctrl-G)
static void attach_include_reply(FILE *fp, FILE *fp_tmp, struct Email *e)
This is very similar to send.c's include_reply()
static struct Body ** copy_problematic_attachments(struct Body **last, struct AttachCtx *actx, bool force)
Attach the body parts which can't be decoded.
static bool check_can_decode(struct AttachCtx *actx, struct Body *b)
Can we decode all tagged attachments?
static struct AttachPtr * find_parent(struct AttachCtx *actx, struct Body *b, short nattach)
Find the parent of an Attachment.
static void include_header(bool quote, FILE *fp_in, struct Email *e, FILE *fp_out, const char *prefix)
Write an email header to a file, optionally quoting it.
static int attach_reply_envelope_defaults(struct Envelope *env, struct AttachCtx *actx, struct Email *parent, SendFlags flags)
Create the envelope defaults for a reply.
#define MUTT_FORMAT_NO_FLAGS
No flags are set.
void mutt_make_attribution_intro(struct Email *e, FILE *fp_out, struct ConfigSubset *sub)
Add "on DATE, PERSON wrote" header.
int mutt_send_message(SendFlags flags, struct Email *e_templ, const char *tempfile, struct Mailbox *m, struct EmailArray *ea, struct ConfigSubset *sub)
Send an email.
void mutt_make_attribution_trailer(struct Email *e, FILE *fp_out, struct ConfigSubset *sub)
Add suffix to replied email text.
#define SEND_NEWS
Reply to a news article.
FILE * fp_root
Used by recvattach for updating.
An email to which things will be attached.
The envelope/body of an email.
struct Body * body
List of MIME parts.
Keep track when processing files.
StateFlags flags
Flags, e.g. STATE_DISPLAY.
FILE * fp_out
File to write to.
FILE * fp_in
File to read from.
const char * prefix
String to add to the beginning of each output line.