Attach a reply.
887{
888 bool mime_reply_any = false;
889
892 if (!first)
893 return;
894
896 FILE *
fp = current->
fp;
899 struct Email *e_parent = NULL;
900 FILE *fp_parent = NULL;
901 struct Email *e_tmp = NULL;
902 FILE *fp_tmp = NULL;
903 struct Buffer *tempfile = NULL;
905
907
910 else
912
913
914
916 {
918 if (parent)
919 {
921 fp_parent = parent->
fp;
922 }
923 else
924 {
925 e_parent = e;
927 }
928 }
929
930
932 {
936 goto cleanup;
938 mime_reply_any = true;
939 }
940 else if (nattach == 1)
941 {
942 mime_reply_any = true;
943 }
944
947
949 e_parent ? e_parent : (b ? b->
email : NULL),
950 flags) == -1)
951 {
952 goto cleanup;
953 }
954
955
956
960 if (!fp_tmp)
961 {
963 goto cleanup;
964 }
965
966 if (e_parent)
967 {
969
970 struct State state = { 0 };
972
974 if (c_text_flowed)
975 {
977 }
978 else
979 {
982 setlocale(LC_TIME,
NONULL(c_attribution_locale));
984 setlocale(LC_TIME, "");
985 }
986
989
991 if (c_weed)
993
995 if (c_header)
997
998 if (nattach == 1)
999 {
1001 {
1005 }
1006 else
1007 {
1009 }
1010 }
1011 else
1012 {
1015 {
1017 {
1018 state.
fp_in = (*app)->fp;
1021 }
1022 }
1023 }
1024
1026
1027 if (mime_reply_any && (nattach > 1) &&
1029 {
1030 goto cleanup;
1031 }
1032 }
1033 else
1034 {
1035 if (nattach == 1)
1036 {
1038 }
1039 else
1040 {
1043 {
1045 }
1046 }
1047 }
1048
1050
1053 {
1055 }
1056 e_tmp = NULL;
1057
1058cleanup:
1059 if (fp_tmp)
1060 {
1063 }
1068}
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
#define ARRAY_FREE(head)
Release all memory.
#define ARRAY_GET(head, idx)
Return the element at index.
#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.
int mutt_body_copy(FILE *fp, struct Body **b_dst, struct Body *b_src)
Create a send-mode duplicate from a receive-mode body.
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.
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.
#define state_putc(STATE, STR)
@ STATE_CHARCONV
Do character set conversions.
@ STATE_WEED
Weed headers even when not in display mode.
@ MUTT_REPLIED
Messages that have been replied to.
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 AttachPtr * find_parent(struct AttachCtx *actx, struct AttachPtrArray *aa)
Find the parent of a selected Attachment set.
static bool check_can_decode(struct AttachPtrArray *aa)
Can we decode all selected attachments?
static int attach_reply_envelope_defaults(struct Envelope *env, struct AttachPtrArray *aa, struct Email *parent, SendFlags flags)
Create the envelope defaults for a reply.
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 struct Body ** copy_problematic_attachments(struct Body **last, struct AttachPtrArray *aa, bool force)
Attach the body parts which can't be decoded.
@ MUTT_FORMAT_NONE
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.
@ SEND_NEWS
Reply to a news article.
FILE * fp_root
Used by recvattach for updating.
struct Body * body
Attachment.
FILE * fp
Used in the recvattach menu.
struct Email * email
header information for message/rfc822
The envelope/body of an email.
struct Envelope * env
Envelope information.
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.
#define buf_mktemp_draft(buf)