74 mutt_error(
_(
"You may only bounce message/rfc822 parts"));
93 for (
short i = 0; i < actx->
idxlen; i++)
116 for (
short i = 0; i < actx->
idxlen; i++)
131 for (
short i = 0; i < actx->
idxlen; i++)
149 while ((++i < actx->idxlen) && (level < actx->idx[i]->level))
165 if (!m || !fp || !actx)
181 mutt_error(
_(
"Warning: message contains no From: header"));
187 for (
short i = 0; i < actx->
idxlen; i++)
193 mutt_error(
_(
"Warning: message contains no From: header"));
209 false, NULL, NULL, NULL) != 0) ||
236#define EXTRA_SPACE (15 + 7 + 2)
238 mutt_buffer_printf(prompt, ngettext(
"Bounce message to %s?",
"Bounce messages to %s?", num_msg),
260 mutt_message(ngettext(
"Message not bounced",
"Messages not bounced", num_msg));
273 for (
short i = 0; i < actx->
idxlen; i++)
287 mutt_message(ngettext(
"Message bounced",
"Messages bounced", num_msg));
289 mutt_error(ngettext(
"Error bouncing message",
"Error bouncing messages", num_msg));
313 for (
short i = 0; i < actx->
idxlen; i++)
336 for (i = 0; i < actx->
idxlen; i++)
345 if (nchildren == nattach)
369 while ((++i < actx->idxlen) && (actx->
idx[i]->
level >
level))
392 for (
short i = 0; i < actx->
idxlen; i++)
397 parent = actx->
idx[i];
431 else if (!c_text_flowed)
458 for (
short i = 0; i < actx->
idxlen; i++)
464 last = &((*last)->next);
481 struct Body *cur,
short nattach)
483 bool mime_fwd_all =
false;
484 bool mime_fwd_any =
true;
485 struct Email *e_parent = NULL;
486 FILE *fp_parent = NULL;
487 char prefix[256] = { 0 };
489 struct Buffer *tmpbody = NULL;
498 fp_parent = parent->
fp;
538 include_header(c_forward_quote, fp_parent, e_parent, fp_tmp, prefix);
562 _(
"Can't decode all tagged attachments. MIME-forward the others?"));
566 mime_fwd_any =
false;
571 struct State st = { 0 };
605 for (
int i = 0; i < actx->
idxlen; i++)
662 struct Email *e_cur = NULL;
663 struct Email *e_tmp = NULL;
665 struct Body **last = NULL;
666 struct Buffer *tmpbody = NULL;
675 for (
short i = 0; i < actx->
idxlen; i++)
714 if (c_forward_decode)
733 for (
short i = 0; i < actx->
idxlen; i++)
753 for (
short i = 0; i < actx->
idxlen; i++)
758 last = &((*last)->next);
822 struct Email *e = NULL;
826 for (
short i = 0; i < actx->
idxlen; i++)
838 curenv = parent->
env;
867 for (
short i = 0; i < actx->
idxlen; i++)
892 for (
short i = 0; i < actx->
idxlen; i++)
944 bool mime_reply_any =
false;
948 struct Email *e_parent = NULL;
949 FILE *fp_parent = NULL;
950 struct Email *e_tmp = NULL;
952 struct Buffer *tmpbody = NULL;
955 char prefix[128] = { 0 };
971 fp_parent = parent->
fp;
985 _(
"Can't decode all tagged attachments. MIME-encapsulate the others?"));
989 mime_reply_any =
true;
991 else if (nattach == 1)
992 mime_reply_any =
true;
998 e_parent ? e_parent : (e_cur ? e_cur->
email : NULL),
1019 for (
short i = 0; i < actx->
idxlen; i++)
1031 memset(&st, 0,
sizeof(
struct State));
1070 for (
short i = 0; i < actx->
idxlen; i++)
1121 mutt_error(
_(
"You may only compose to sender with message/rfc822 parts"));
1138 for (
int i = 0; i < actx->
idxlen; i++)
void mutt_addrlist_clear(struct AddressList *al)
Unlink and free all Address in an AddressList.
size_t mutt_addrlist_write(const struct AddressList *al, char *buf, size_t buflen, bool display)
Write an Address to a buffer.
int mutt_addrlist_parse(struct AddressList *al, const char *s)
Parse a list of email addresses.
int mutt_addrlist_to_intl(struct AddressList *al, char **err)
Convert an Address list to Punycode.
void mutt_expand_aliases(struct AddressList *al)
Expand aliases in a List of Addresses.
GUI display the mailboxes in a side panel.
void mutt_buffer_alloc(struct Buffer *buf, size_t new_size)
Make sure a buffer can store at least new_size bytes.
bool mutt_buffer_is_empty(const struct Buffer *buf)
Is the Buffer empty?
size_t mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
size_t mutt_buffer_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
size_t mutt_buffer_copy(struct Buffer *dst, const struct Buffer *src)
Copy a Buffer's contents to another Buffer.
void mutt_buffer_reset(struct Buffer *buf)
Reset an existing Buffer.
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
enum QuadOption cs_subset_quad(const struct ConfigSubset *sub, const char *name)
Get a quad-value config item by name.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Convenience wrapper for the config headers.
int mutt_copy_header(FILE *fp_in, struct Email *e, FILE *fp_out, CopyHeaderFlags chflags, const char *prefix, int wraplen)
Copy Email header.
int mutt_copy_message_fp(FILE *fp_out, FILE *fp_in, struct Email *e, CopyMessageFlags cmflags, CopyHeaderFlags chflags, int wraplen)
Make a copy of a message from a FILE pointer.
Duplicate the structure of an entire email.
#define CH_DECODE
Do RFC2047 header decoding.
#define MUTT_CM_WEED
Weed message/rfc822 attachment headers.
#define MUTT_CM_PREFIX
Quote the header and body.
#define CH_PREFIX
Quote header using $indent_string string?
#define MUTT_CM_DECODE
Decode the message body into text/plain.
#define CH_WEED
Weed the headers?
#define CH_REORDER
Re-order output of headers (specified by 'hdr_order')
#define MUTT_CM_CHARCONV
Perform character set conversions.
uint32_t CopyHeaderFlags
Flags for mutt_copy_header(), e.g. CH_UPDATE.
#define MUTT_CM_NO_FLAGS
No flags are set.
#define MUTT_CM_NOHEADER
Don't copy the message header.
uint16_t CopyMessageFlags
Flags for mutt_copy_message(), e.g. MUTT_CM_NOHEADER.
Convenience wrapper for the core headers.
void mutt_simple_format(char *buf, size_t buflen, int min_width, int max_width, enum FormatJustify justify, char pad_char, const char *s, size_t n, bool arboreal)
Format a string, like snprintf()
size_t mutt_strwidth(const char *s)
Measure a string's width in screen cells.
@ JUSTIFY_LEFT
Left justify the text.
int emaillist_add_email(struct EmailList *el, struct Email *e)
Add an Email to a list.
struct Email * email_new(void)
Create a new Email.
void email_free(struct Email **ptr)
Free an Email.
void emaillist_clear(struct EmailList *el)
Drop a private list of Emails.
Structs that make up an email.
int mutt_buffer_get_field(const char *field, struct Buffer *buf, CompletionFlags complete, bool multiple, struct Mailbox *m, char ***files, int *numfiles)
Ask the user for a string.
struct Envelope * mutt_env_new(void)
Create a new Envelope.
FILE * mutt_file_fopen(const char *path, const char *mode)
Call fopen() safely.
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
void mutt_file_unlink(const char *s)
Delete a file, carefully.
#define mutt_message(...)
Convenience wrapper for the gui headers.
bool mutt_can_decode(struct Body *b)
Will decoding the attachment produce any output.
int mutt_body_handler(struct Body *b, struct State *s)
Handler for the Body of an email.
Decide how to display email content.
void mutt_make_string(char *buf, size_t buflen, int cols, const char *s, struct Mailbox *m, int inpgr, struct Email *e, MuttFormatFlags flags, const char *progress)
Create formatted strings using mailbox expandos.
String processing routines to generate the mail index.
size_t msgwin_get_width(void)
Get the width of the Message Window.
void msgwin_clear_text(void)
Clear the text in the Message Window.
Convenience wrapper for the library headers.
#define MUTT_WEED
Weed headers even when not in display mode.
#define state_putc(STATE, STR)
#define MUTT_CHARCONV
Do character set conversions.
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
char * mutt_str_dup(const char *str)
Copy a string, safely.
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Many unsorted constants and some structs.
#define MUTT_COMP_ALIAS
Alias completion (in alias dialog)
@ MUTT_REPLIED
Messages that have been replied to.
int mutt_body_copy(FILE *fp, struct Body **tgt, struct Body *src)
Create a send-mode duplicate from a receive-mode body.
Representation of the body of an email.
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
Some miscellaneous functions.
#define mutt_buffer_mktemp(buf)
Handling of global boolean variables.
bool OptNewsSend
(pseudo) used to change behavior when posting
bool mutt_is_message_type(int type, const char *subtype)
Determine if a mime type matches a message or not.
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
Prototypes for many functions.
#define mutt_set_flag(m, e, flag, bf)
QuadOption
Possible values for a quad-option.
@ MUTT_ABORT
User aborted the question (with Ctrl-G)
@ MUTT_NO
User answered 'No', or assume 'No'.
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
enum QuadOption query_quadoption(enum QuadOption opt, const char *prompt)
Ask the user a quad-question.
#define STAILQ_HEAD_INITIALIZER(head)
#define TAILQ_HEAD_INITIALIZER(head)
#define TAILQ_EMPTY(head)
static void attach_include_reply(FILE *fp, FILE *fp_tmp, struct Email *e)
This is very similar to send.c's include_reply()
void mutt_attach_forward(FILE *fp, struct Email *e, struct AttachCtx *actx, struct Body *cur, SendFlags flags)
Forward an Attachment.
static struct Body ** copy_problematic_attachments(struct Body **last, struct AttachCtx *actx, bool force)
Attach the body parts which can't be decoded.
static int is_parent(short i, struct AttachCtx *actx, const struct Body *cur)
Check whether one attachment is the parent of another.
static short count_tagged(struct AttachCtx *actx)
Count the number of tagged attachments.
void mutt_attach_mail_sender(struct AttachCtx *actx, struct Body *cur)
Compose an email to the sender in the email attachment.
static short count_tagged_children(struct AttachCtx *actx, short i)
Tagged children below a multipart/message attachment.
void mutt_attach_resend(FILE *fp, struct Mailbox *m, struct AttachCtx *actx, struct Body *cur)
Resend-message, from the attachment menu.
static void include_header(bool quote, FILE *fp_in, struct Email *e, FILE *fp_out, char *prefix)
Write an email header to a file, optionally quoting it.
static struct AttachPtr * find_common_parent(struct AttachCtx *actx, short nattach)
Find a common parent message for the tagged attachments.
static void attach_forward_bodies(FILE *fp, struct Email *e, struct AttachCtx *actx, struct Body *cur, short nattach)
Forward one or several MIME bodies.
static bool check_can_decode(struct AttachCtx *actx, struct Body *cur)
Can we decode all tagged attachments?
void mutt_attach_bounce(struct Mailbox *m, FILE *fp, struct AttachCtx *actx, struct Body *cur)
Bounce function, from the attachment menu.
static void attach_forward_msgs(FILE *fp, struct AttachCtx *actx, struct Body *cur, SendFlags flags)
Forward one or several message-type attachments.
static struct AttachPtr * find_parent(struct AttachCtx *actx, struct Body *cur, short nattach)
Find the parent of an Attachment.
static int attach_reply_envelope_defaults(struct Envelope *env, struct AttachCtx *actx, struct Email *parent, SendFlags flags)
Create the envelope defaults for a reply.
void mutt_attach_reply(FILE *fp, struct Mailbox *m, struct Email *e, struct AttachCtx *actx, struct Body *e_cur, SendFlags flags)
Attach a reply.
static bool check_msg(struct Body *b, bool err)
Are we working with an RFC822 message.
static bool check_all_msg(struct AttachCtx *actx, struct Body *cur, bool err)
Are all the Attachments RFC822 messages?
Send/reply with an attachment.
Convenience wrapper for the send headers.
void mutt_make_post_indent(struct Email *e, FILE *fp_out, struct ConfigSubset *sub)
Add suffix to replied email text.
void mutt_make_misc_reply_headers(struct Envelope *env, struct Envelope *curenv, struct ConfigSubset *sub)
Set subject for a reply.
void mutt_forward_intro(struct Email *e, FILE *fp, struct ConfigSubset *sub)
Add the "start of forwarded message" text.
void mutt_make_forward_subject(struct Envelope *env, struct Email *e, struct ConfigSubset *sub)
Create a subject for a forwarded email.
void mutt_add_to_reference_headers(struct Envelope *env, struct Envelope *curenv, struct ConfigSubset *sub)
Generate references for a reply email.
void mutt_fix_reply_recipients(struct Envelope *env, struct ConfigSubset *sub)
Remove duplicate recipients.
int mutt_resend_message(FILE *fp, struct Mailbox *m, struct Email *e_cur, struct ConfigSubset *sub)
Resend an email.
int mutt_fetch_recips(struct Envelope *out, struct Envelope *in, SendFlags flags, struct ConfigSubset *sub)
Generate recpients for a reply email.
void mutt_make_attribution(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 EmailList *el, struct ConfigSubset *sub)
Send an email.
void mutt_forward_trailer(struct Email *e, FILE *fp, struct ConfigSubset *sub)
Add a "end of forwarded message" text.
#define SEND_LIST_REPLY
Reply to mailing list.
#define SEND_TO_SENDER
Compose new email to sender.
#define SEND_NO_FLAGS
No flags are set.
#define SEND_NEWS
Reply to a news article.
uint16_t SendFlags
Flags for mutt_send_message(), e.g. SEND_REPLY.
int mutt_bounce_message(FILE *fp, struct Mailbox *m, struct Email *e, struct AddressList *to, struct ConfigSubset *sub)
Bounce an email message.
FILE * fp_root
Used by recvattach for updating.
struct AttachPtr ** idx
Array of attachments.
short idxlen
Number of attachmentes.
An email to which things will be attached.
struct Body * body
Attachment.
int level
Nesting depth of attachment.
FILE * fp
Used in the recvattach menu.
struct Email * email
header information for message/rfc822
bool tagged
This attachment is tagged.
char * subtype
content-type subtype
unsigned int type
content-type primary type, ContentType
String manipulation buffer.
size_t dsize
Length of data.
char * data
Pointer to data.
The envelope/body of an email.
struct Envelope * env
Envelope information.
struct Body * body
List of MIME parts.
struct AddressList to
Email's 'To' list.
char * followup_to
List of 'followup-to' fields.
char * newsgroups
List of newsgroups.
struct AddressList from
Email's 'From' list.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
Keep track when processing files.
StateFlags flags
Flags, e.g. MUTT_DISPLAY.
FILE * fp_out
File to write to.
char * prefix
String to add to the beginning of each output line.
FILE * fp_in
File to read from.