33#include "docs/makedoc_defs.h"
88 {
"attach-file", OP_ATTACHMENT_ATTACH_FILE },
89 {
"attach-key", OP_ATTACHMENT_ATTACH_KEY },
90 {
"attach-message", OP_ATTACHMENT_ATTACH_MESSAGE },
91 {
"attach-news-message", OP_ATTACHMENT_ATTACH_NEWS_MESSAGE },
93 {
"autocrypt-menu", OP_COMPOSE_AUTOCRYPT_MENU },
95 {
"copy-file", OP_ATTACHMENT_SAVE },
96 {
"detach-file", OP_ATTACHMENT_DETACH },
97 {
"display-toggle-weed", OP_DISPLAY_HEADERS },
98 {
"edit-bcc", OP_ENVELOPE_EDIT_BCC },
99 {
"edit-cc", OP_ENVELOPE_EDIT_CC },
100 {
"edit-content-id", OP_ATTACHMENT_EDIT_CONTENT_ID },
101 {
"edit-description", OP_ATTACHMENT_EDIT_DESCRIPTION },
102 {
"edit-encoding", OP_ATTACHMENT_EDIT_ENCODING },
103 {
"edit-fcc", OP_ENVELOPE_EDIT_FCC },
104 {
"edit-file", OP_COMPOSE_EDIT_FILE },
105 {
"edit-followup-to", OP_ENVELOPE_EDIT_FOLLOWUP_TO },
106 {
"edit-from", OP_ENVELOPE_EDIT_FROM },
107 {
"edit-headers", OP_ENVELOPE_EDIT_HEADERS },
108 {
"edit-language", OP_ATTACHMENT_EDIT_LANGUAGE },
109 {
"edit-message", OP_COMPOSE_EDIT_MESSAGE },
110 {
"edit-mime", OP_ATTACHMENT_EDIT_MIME },
111 {
"edit-newsgroups", OP_ENVELOPE_EDIT_NEWSGROUPS },
112 {
"edit-reply-to", OP_ENVELOPE_EDIT_REPLY_TO },
113 {
"edit-subject", OP_ENVELOPE_EDIT_SUBJECT },
114 {
"edit-to", OP_ENVELOPE_EDIT_TO },
115 {
"edit-type", OP_ATTACHMENT_EDIT_TYPE },
116 {
"edit-x-comment-to", OP_ENVELOPE_EDIT_X_COMMENT_TO },
118 {
"filter-entry", OP_ATTACHMENT_FILTER },
119 {
"forget-passphrase", OP_FORGET_PASSPHRASE },
120 {
"get-attachment", OP_ATTACHMENT_GET_ATTACHMENT },
121 {
"group-alternatives", OP_ATTACHMENT_GROUP_ALTS },
122 {
"group-multilingual", OP_ATTACHMENT_GROUP_LINGUAL },
123 {
"group-related", OP_ATTACHMENT_GROUP_RELATED },
124 {
"ispell", OP_COMPOSE_ISPELL },
125 {
"move-down", OP_ATTACHMENT_MOVE_DOWN },
126 {
"move-up", OP_ATTACHMENT_MOVE_UP },
127 {
"new-mime", OP_ATTACHMENT_NEW_MIME },
128 {
"pgp-menu", OP_COMPOSE_PGP_MENU },
129 {
"pipe-entry", OP_PIPE },
130 {
"pipe-message", OP_PIPE },
131 {
"postpone-message", OP_COMPOSE_POSTPONE_MESSAGE },
132 {
"print-entry", OP_ATTACHMENT_PRINT },
133 {
"rename-attachment", OP_ATTACHMENT_RENAME_ATTACHMENT },
134 {
"rename-file", OP_COMPOSE_RENAME_FILE },
135 {
"send-message", OP_COMPOSE_SEND_MESSAGE },
136 {
"smime-menu", OP_COMPOSE_SMIME_MENU },
137 {
"toggle-disposition", OP_ATTACHMENT_TOGGLE_DISPOSITION },
138 {
"toggle-recode", OP_ATTACHMENT_TOGGLE_RECODE },
139 {
"toggle-unlink", OP_ATTACHMENT_TOGGLE_UNLINK },
140 {
"ungroup-attachment", OP_ATTACHMENT_UNGROUP },
141 {
"update-encoding", OP_ATTACHMENT_UPDATE_ENCODING },
142 {
"view-attach", OP_ATTACHMENT_VIEW },
143 {
"view-mailcap", OP_ATTACHMENT_VIEW_MAILCAP },
144 {
"view-pager", OP_ATTACHMENT_VIEW_PAGER },
145 {
"view-text", OP_ATTACHMENT_VIEW_TEXT },
146 {
"write-fcc", OP_COMPOSE_WRITE_MESSAGE },
154 { OP_ATTACHMENT_ATTACH_FILE,
"a" },
155 { OP_ATTACHMENT_ATTACH_KEY,
"\033k" },
156 { OP_ATTACHMENT_ATTACH_MESSAGE,
"A" },
157 { OP_ATTACHMENT_DETACH,
"D" },
158 { OP_ATTACHMENT_EDIT_CONTENT_ID,
"\033i" },
159 { OP_ATTACHMENT_EDIT_DESCRIPTION,
"d" },
160 { OP_ATTACHMENT_EDIT_ENCODING,
"\005" },
161 { OP_ATTACHMENT_EDIT_LANGUAGE,
"\014" },
162 { OP_ATTACHMENT_EDIT_MIME,
"m" },
163 { OP_ATTACHMENT_EDIT_TYPE,
"\024" },
164 { OP_ATTACHMENT_FILTER,
"F" },
165 { OP_ATTACHMENT_GET_ATTACHMENT,
"G" },
166 { OP_ATTACHMENT_GROUP_ALTS,
"&" },
167 { OP_ATTACHMENT_GROUP_LINGUAL,
"^" },
168 { OP_ATTACHMENT_GROUP_RELATED,
"%" },
169 { OP_ATTACHMENT_MOVE_DOWN,
"+" },
170 { OP_ATTACHMENT_MOVE_UP,
"-" },
171 { OP_ATTACHMENT_NEW_MIME,
"n" },
174 { OP_ATTACHMENT_PRINT,
"l" },
175 { OP_ATTACHMENT_RENAME_ATTACHMENT,
"\017" },
176 { OP_ATTACHMENT_SAVE,
"C" },
177 { OP_ATTACHMENT_TOGGLE_DISPOSITION,
"\004" },
178 { OP_ATTACHMENT_TOGGLE_UNLINK,
"u" },
179 { OP_ATTACHMENT_UNGROUP,
"#" },
180 { OP_ATTACHMENT_UPDATE_ENCODING,
"U" },
181 { OP_ATTACHMENT_VIEW,
"<keypadenter>" },
182 { OP_ATTACHMENT_VIEW,
"\n" },
183 { OP_ATTACHMENT_VIEW,
"\r" },
185 { OP_COMPOSE_AUTOCRYPT_MENU,
"o" },
187 { OP_COMPOSE_EDIT_FILE,
"\033e" },
188 { OP_COMPOSE_EDIT_MESSAGE,
"e" },
189 { OP_COMPOSE_ISPELL,
"i" },
190 { OP_COMPOSE_PGP_MENU,
"p" },
191 { OP_COMPOSE_POSTPONE_MESSAGE,
"P" },
192 { OP_COMPOSE_RENAME_FILE,
"R" },
193 { OP_COMPOSE_SEND_MESSAGE,
"y" },
194 { OP_COMPOSE_SMIME_MENU,
"S" },
195 { OP_COMPOSE_WRITE_MESSAGE,
"w" },
196 { OP_DISPLAY_HEADERS,
"h" },
197 { OP_ENVELOPE_EDIT_BCC,
"b" },
198 { OP_ENVELOPE_EDIT_CC,
"c" },
199 { OP_ENVELOPE_EDIT_FCC,
"f" },
200 { OP_ENVELOPE_EDIT_FROM,
"\033f" },
201 { OP_ENVELOPE_EDIT_HEADERS,
"E" },
202 { OP_ENVELOPE_EDIT_REPLY_TO,
"r" },
203 { OP_ENVELOPE_EDIT_SUBJECT,
"s" },
204 { OP_ENVELOPE_EDIT_TO,
"t" },
205 { OP_FORGET_PASSPHRASE,
"\006" },
251 static const char *check =
"^[-\\.0-9@A-Z_a-z]+$";
272 struct stat st = { 0 };
273 struct Buffer *pretty = NULL, *msg = NULL;
275 for (
int i = 0; i < actx->
idxlen; i++)
306 buf_printf(msg,
_(
"Attachment #%d modified. Update encoding for %s?"),
334 if (!actx || (aidx < 0) || (aidx >= actx->
idxlen))
338 struct Body *b_previous = NULL;
339 struct Body *b_parent = NULL;
346 mutt_error(
_(
"You may not delete the only attachment"));
358 "compose_confirm_detach_first");
367 if (idx[aidx]->level > 0)
373 mutt_error(
_(
"Can't leave group with only one attachment"));
390 if (aidx < (actx->
idxlen - 1))
400 for (
int i = 0; i < part_count; i++)
402 FREE(&idx[aidx + i]->tree);
403 FREE(&idx[aidx + i]);
407 for (
int i = aidx; i < (actx->
idxlen - part_count); i++)
408 idx[i] = idx[i + part_count];
409 for (
int i = 0; i < part_count; i++)
410 idx[actx->
idxlen - i - 1] = NULL;
411 actx->
idxlen -= part_count;
425 for (
int i = actx->
idxlen; i > 0; i--)
466 struct Body *b_previous = NULL;
467 struct Body *b_parent = NULL;
472 b_previous->
next = idx[second]->
body;
484 for (
int i = second; i > first; i--)
495 int destidx = i - second + first;
496 for (
int j = i; j > destidx; j--)
498 idx[destidx] = saved;
516 int group_level = -1;
517 struct Body *bptr_parent = NULL;
520 for (
int i = 0; i < actx->
idxlen; i++)
525 if (group_level == -1)
531 if (group_level != actx->
idx[i]->
level)
533 mutt_error(
_(
"Attachments to be grouped must have the same parent"));
542 struct Body *bptr_test = NULL;
545 if (bptr_test != bptr_parent)
547 mutt_error(
_(
"Attachments to be grouped must have the same parent"));
565 mutt_error(
_(
"Can't leave group with only one attachment"));
575 struct Body *bptr_first = NULL;
576 struct Body *bptr = NULL;
577 struct Body *group_parent = NULL;
578 struct Body *group_previous = NULL;
579 struct Body *group_part = NULL;
581 int group_last_idx = 0;
584 for (
int i = 0; i < actx->
idxlen; i++)
616 struct Body *bptr_previous = NULL;
627 group_part->
next = bptr;
628 group_part = group_part->
next;
629 group_part->
next = NULL;
633 for (
int j = i + 1; j < (i + bptr_attachments); j++)
635 if (i > (group_last_idx + 1))
637 for (
int j = 0; j < bptr_attachments; j++)
639 struct AttachPtr *saved = actx->
idx[i + bptr_attachments - 1];
640 for (
int k = i + bptr_attachments - 1; k > (group_last_idx + 1); k--)
641 actx->
idx[k] = actx->
idx[k - 1];
642 actx->
idx[group_last_idx + 1] = saved;
645 i += bptr_attachments - 1;
646 group_last_idx += bptr_attachments;
653 group_part->
next = NULL;
655 for (
int j = i + 1; j < (i + bptr_attachments); j++)
657 i += bptr_attachments - 1;
674 struct Body *b = NULL;
675 struct Body *b_parent = NULL;
676 while (next_aidx < actx->idxlen)
678 b = actx->
idx[next_aidx]->
body;
682 if (group_parent == b_parent)
691 else if (next_aidx < actx->idxlen)
699 group_previous->
next = group;
700 else if (group_parent)
701 group_parent->
parts = group;
706 group_ap->
body = group;
708 group_ap->
level = group_level;
733 char *prompt =
_(
"Attach file");
738 if ((
mw_enter_fname(prompt, fname,
false, NULL,
true, &files, &numfiles,
742 for (
int i = 0; i < numfiles; i++)
751 bool added_attachment =
false;
755 "Attaching selected files...", numfiles));
757 for (
int i = 0; i < numfiles; i++)
759 char *att = files[i];
768 added_attachment =
true;
788 if (added_attachment)
826 char *prompt =
_(
"Open mailbox to attach message from");
829 if (shared->
mailbox && (op == OP_ATTACHMENT_ATTACH_NEWS_MESSAGE))
836 prompt =
_(
"Open newsgroup to attach message from");
886 const bool old_readonly = m_attach->
readonly;
907 const unsigned char old_use_threads =
cs_subset_enum(shared->
sub,
"use_threads");
929 bool added_attachment =
false;
930 for (
int i = 0; i < m_attach_new->
msg_count; i++)
932 if (!m_attach_new->
emails[i])
942 added_attachment =
true;
953 if (m_attach_new == m_attach)
964 if (added_attachment)
988 for (
int i = 0; i < actx->
idxlen; i++)
1044 mutt_error(
_(
"Content-ID can only contain the characters: -.0-9@A-Z_a-z"));
1223 mutt_error(
_(
"Can't filter multipart attachments"));
1227 (op == OP_ATTACHMENT_FILTER));
1228 if (op == OP_ATTACHMENT_FILTER)
1253 struct Body **bp = NULL;
1280 mutt_error(
_(
"Grouping 'alternatives' requires at least 2 tagged messages"));
1294 mutt_error(
_(
"Grouping 'multilingual' requires at least 2 tagged messages"));
1299 int tagged_with_lang_num = 0;
1301 if (b->tagged && b->language && *b->language)
1302 tagged_with_lang_num++;
1306 if (
query_yesorno(
_(
"Not all parts have 'Content-Language' set, continue?"),
1324 mutt_error(
_(
"Grouping 'related' requires at least 2 tagged messages"));
1355 if (index == (actx->
idxlen - 1))
1363 mutt_error(
_(
"Attachment can't be moved out of group"));
1368 int nextidx = index + 1;
1369 while ((nextidx < actx->
idxlen) &&
1374 if (nextidx == actx->
idxlen)
1381 int finalidx = index + 1;
1382 if (nextidx < actx->
idxlen - 1)
1416 mutt_error(
_(
"Attachment can't be moved out of group"));
1421 int previdx = index - 1;
1422 while ((previdx > 0) && (actx->
idx[previdx]->
level > actx->
idx[index]->
level))
1439 struct Buffer *type = NULL;
1463 mutt_error(
_(
"Content-Type is of the form base/sub"));
1529 mutt_error(
_(
"Can't print multipart attachments"));
1555 int rc =
mw_get_field(
_(
"Send attachment with name: "), fname,
1580 mutt_error(
_(
"Can't save multipart attachments"));
1615 mutt_error(
_(
"Recoding only affects text attachments"));
1620 mutt_message(
_(
"The current attachment won't be converted"));
1622 mutt_message(
_(
"The current attachment will be converted"));
1659 struct Body *b_previous = NULL;
1660 struct Body *b_parent = NULL;
1662 int level = actx->
idx[aidx]->
level;
1674 while (actx->
idx[i]->
level > level)
1698 for (
int j = aidx; j < (actx->
idxlen - 1); j++)
1699 actx->
idx[j] = actx->
idx[j + 1];
1724 struct Body **bp = NULL;
1748 const char *tag = NULL;
1800 mutt_error(
_(
"Can't edit multipart attachments"));
1819 if (!c_edit_headers)
1881 mutt_error(
_(
"Can't rename multipart attachments"));
1892 struct stat st = { 0 };
1911 if (cur_att->
body->
stamp >= st.st_mtime)
1935 shared->
sub,
"copy");
1971 NULL, shared->
sub) == 0)
2000 case OP_ATTACHMENT_VIEW:
2001 case OP_DISPLAY_HEADERS:
2004 case OP_ATTACHMENT_VIEW_MAILCAP:
2008 case OP_ATTACHMENT_VIEW_PAGER:
2012 case OP_ATTACHMENT_VIEW_TEXT:
2041 shared->
sub,
"postpone");
2142 if (!dlg || !dlg->
wdata)
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
#define ARRAY_EMPTY(head)
Check if an array is empty.
#define ARRAY_FREE(head)
Release all memory.
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
void mutt_actx_add_attach(struct AttachCtx *actx, struct AttachPtr *attach)
Add an Attachment to an Attachment Context.
void mutt_actx_ins_attach(struct AttachCtx *actx, struct AttachPtr *attach, int aidx)
Insert an Attachment into an Attachment Context at Specified Index.
struct AttachPtr * mutt_aptr_new(void)
Create a new Attachment Pointer.
void mutt_actx_entries_free(struct AttachCtx *actx)
Free entries in an Attachment Context.
void mutt_aptr_free(struct AttachPtr **ptr)
Free an Attachment Pointer.
bool attach_body_parent(struct Body *start, struct Body *start_parent, struct Body *body, struct Body **body_parent)
Find the parent of a body.
int attach_body_count(struct Body *body, bool recurse)
Count bodies.
bool attach_body_previous(struct Body *start, struct Body *body, struct Body **previous)
Find the previous body of a body.
GUI display the mailboxes in a side panel.
const struct CompleteOps CompleteFileOps
Auto-Completion of Files.
Select a Mailbox from a list.
#define MUTT_SEL_MULTI
Multi-selection is enabled.
#define MUTT_SEL_NO_FLAGS
No flags are set.
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
static bool check_count(struct AttachCtx *actx)
Check if there are any attachments.
static const struct ComposeFunction ComposeFunctions[]
All the NeoMutt functions that the Compose supports.
const struct MenuFuncOp OpCompose[]
Functions for the Compose Menu.
static int group_attachments(struct ComposeSharedData *shared, char *subtype)
Group tagged attachments into a multipart group.
static void update_idx(struct Menu *menu, struct AttachCtx *actx, struct AttachPtr *ap)
Add a new attachment to the message.
static char * gen_cid(void)
Generate a random Content ID.
static void compose_attach_swap(struct Email *e, struct AttachCtx *actx, int first, int second)
Swap two adjacent entries in the attachment list.
static bool check_cid(const char *cid)
Check if a Content-ID is valid.
static int check_attachments(struct AttachCtx *actx, struct ConfigSubset *sub)
Check if any attachments have changed or been deleted.
const struct MenuOpSeq ComposeDefaultBindings[]
Key bindings for the Compose Menu.
static int delete_attachment(struct AttachCtx *actx, int aidx)
Delete an attachment.
#define MUTT_COMPOSE_NOFREEHEADER
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
unsigned char cs_subset_enum(const struct ConfigSubset *sub, const char *name)
Get a enumeration config item by name.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
short cs_subset_sort(const struct ConfigSubset *sub, const char *name)
Get a sort config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
@ MUTT_POP
'POP3' Mailbox type
@ MUTT_NNTP
'NNTP' (Usenet) Mailbox type
@ MUTT_IMAP
'IMAP' Mailbox type
void crypt_forget_passphrase(void)
Forget a passphrase and display a message.
struct Body * crypt_pgp_make_key_attachment(void)
Wrapper for CryptModuleSpecs::pgp_make_key_attachment()
void mutt_edit_file(const char *editor, const char *file)
Let the user edit a file.
void dialog_push(struct MuttWindow *dlg)
Display a Window to the user.
void dialog_pop(void)
Hide a Window from the user.
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
const char * dispatcher_get_retval_name(int rv)
Get the name of a return value.
@ FR_SUCCESS
Valid function - successfully performed.
@ FR_DONE
Exit the Dialog.
@ FR_UNKNOWN
Unknown function.
@ FR_ERROR
Valid function - error occurred.
@ FR_NOT_IMPL
Invalid function - feature not enabled.
@ FR_NO_ACTION
Valid function - no action performed.
void update_menu(struct AttachCtx *actx, struct Menu *menu, bool init)
Redraw the compose window.
struct MuttWindow * index_pager_init(void)
Allocate the Windows for the Index/Pager.
void mutt_body_free(struct Body **ptr)
Free a Body.
struct Body * mutt_body_new(void)
Create a new Body.
Structs that make up an email.
enum ContentType mutt_check_mime_type(const char *s)
Check a MIME type string.
int mutt_check_encoding(const char *c)
Check the encoding type.
@ NT_EMAIL_CHANGE_ATTACH
Email's Attachments have changed.
@ NT_EMAIL_CHANGE_ENVELOPE
Email's Envelope has changed.
int mutt_env_to_intl(struct Envelope *env, const char **tag, char **err)
Convert an Envelope's Address fields to Punycode format.
void mutt_env_to_local(struct Envelope *env)
Convert an Envelope's Address fields to local format.
bool mutt_edit_content_type(struct Email *e, struct Body *b, FILE *fp)
Edit the content type of an attachment.
Manage where the email is piped to external commands.
int mutt_file_rename(const char *oldfile, const char *newfile)
Rename a file.
#define mutt_file_fclose(FP)
#define mutt_file_fopen(PATH, MODE)
bool OptNews
(pseudo) used to change reader mode
static int op_exit(struct AliasMenuData *mdata, int op)
exit this menu - Implements alias_function_t -
static int op_attachment_print(struct AttachPrivateData *priv, int op)
print the current entry - Implements attach_function_t -
static int op_attachment_edit_type(struct AttachPrivateData *priv, int op)
edit attachment content type - Implements attach_function_t -
static int op_forget_passphrase(struct AttachPrivateData *priv, int op)
wipe passphrases from memory - Implements attach_function_t -
static int op_attachment_save(struct AttachPrivateData *priv, int op)
save message/attachment to a mailbox/file - Implements attach_function_t -
static int op_attachment_group_lingual(struct ComposeSharedData *shared, int op)
Group tagged attachments as 'multipart/multilingual' - Implements compose_function_t -.
static int op_attachment_group_alts(struct ComposeSharedData *shared, int op)
Group tagged attachments as 'multipart/alternative' - Implements compose_function_t -.
static int op_attachment_filter(struct ComposeSharedData *shared, int op)
Filter attachment through a shell command - Implements compose_function_t -.
static int op_compose_rename_file(struct ComposeSharedData *shared, int op)
Rename/move an attached file - Implements compose_function_t -.
static int op_compose_ispell(struct ComposeSharedData *shared, int op)
Run ispell on the message - Implements compose_function_t -.
static int op_attachment_edit_description(struct ComposeSharedData *shared, int op)
Edit attachment description - Implements compose_function_t -.
static int op_attachment_group_related(struct ComposeSharedData *shared, int op)
Group tagged attachments as 'multipart/related' - Implements compose_function_t -.
static int op_display_headers(struct ComposeSharedData *shared, int op)
Display message and toggle header weeding - Implements compose_function_t -.
static int op_attachment_attach_key(struct ComposeSharedData *shared, int op)
Attach a PGP public key - Implements compose_function_t -.
static int op_compose_edit_file(struct ComposeSharedData *shared, int op)
Edit the file to be attached - Implements compose_function_t -.
static int op_attachment_rename_attachment(struct ComposeSharedData *shared, int op)
Send attachment with a different name - Implements compose_function_t -.
static int op_attachment_move_down(struct ComposeSharedData *shared, int op)
Move an attachment down in the attachment list - Implements compose_function_t -.
static int op_compose_send_message(struct ComposeSharedData *shared, int op)
Send the message - Implements compose_function_t -.
static int op_attachment_attach_file(struct ComposeSharedData *shared, int op)
Attach files to this message - Implements compose_function_t -.
static int op_attachment_toggle_unlink(struct ComposeSharedData *shared, int op)
Toggle whether to delete file after sending it - Implements compose_function_t -.
static int op_attachment_toggle_recode(struct ComposeSharedData *shared, int op)
Toggle recoding of this attachment - Implements compose_function_t -.
static int op_attachment_move_up(struct ComposeSharedData *shared, int op)
Move an attachment up in the attachment list - Implements compose_function_t -.
static int op_attachment_edit_language(struct ComposeSharedData *shared, int op)
Edit the 'Content-Language' of the attachment - Implements compose_function_t -.
static int op_envelope_edit_headers(struct ComposeSharedData *shared, int op)
Edit the message with headers - Implements compose_function_t -.
static int op_attachment_toggle_disposition(struct ComposeSharedData *shared, int op)
Toggle disposition between inline/attachment - Implements compose_function_t -.
static int op_attachment_edit_encoding(struct ComposeSharedData *shared, int op)
Edit attachment transfer-encoding - Implements compose_function_t -.
static int op_attachment_update_encoding(struct ComposeSharedData *shared, int op)
Update an attachment's encoding info - Implements compose_function_t -.
static int op_attachment_attach_message(struct ComposeSharedData *shared, int op)
Attach messages to this message - Implements compose_function_t -.
static int op_attachment_ungroup(struct ComposeSharedData *shared, int op)
Ungroup a 'multipart' attachment - Implements compose_function_t -.
static int op_attachment_edit_content_id(struct ComposeSharedData *shared, int op)
Edit the 'Content-ID' of the attachment - Implements compose_function_t -.
static int op_attachment_get_attachment(struct ComposeSharedData *shared, int op)
Get a temporary copy of an attachment - Implements compose_function_t -.
static int op_compose_write_message(struct ComposeSharedData *shared, int op)
Write the message to a folder - Implements compose_function_t -.
static int op_attachment_edit_mime(struct ComposeSharedData *shared, int op)
Edit attachment using mailcap entry - Implements compose_function_t -.
static int op_compose_edit_message(struct ComposeSharedData *shared, int op)
Edit the message - Implements compose_function_t -.
static int op_attachment_detach(struct ComposeSharedData *shared, int op)
Delete the current entry - Implements compose_function_t -.
static int op_compose_postpone_message(struct ComposeSharedData *shared, int op)
Save this message to send later - Implements compose_function_t -.
static int op_attachment_new_mime(struct ComposeSharedData *shared, int op)
Compose new attachment using mailcap entry - Implements compose_function_t -.
int compose_function_dispatcher(struct MuttWindow *win, int op)
Perform a Compose function - Implements function_dispatcher_t -.
struct Mailbox * dlg_index(struct MuttWindow *dlg, struct Mailbox *m_init)
Display a list of emails -.
int mw_enter_fname(const char *prompt, struct Buffer *fname, bool mailbox, struct Mailbox *m, bool multiple, char ***files, int *numfiles, SelectFileFlags flags)
Ask the user to select a file -.
int mw_get_field(const char *prompt, struct Buffer *buf, CompletionFlags complete, enum HistoryClass hclass, const struct CompleteOps *comp_api, void *cdata)
Ask the user for a string -.
#define mutt_warning(...)
#define mutt_message(...)
#define mutt_debug(LEVEL,...)
enum MailboxType nntp_path_probe(const char *path, const struct stat *st)
Is this an NNTP Mailbox? - Implements MxOps::path_probe() -.
enum MailboxType pop_path_probe(const char *path, const struct stat *st)
Is this a POP Mailbox? - Implements MxOps::path_probe() -.
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox? - Implements MxOps::path_probe() -.
Convenience wrapper for the gui headers.
Read/write command history from/to a file.
@ HC_OTHER
Miscellaneous strings.
void mutt_message_hook(struct Mailbox *m, struct Email *e, HookFlags type)
Perform a message hook.
Parse and execute user-defined hooks.
#define MUTT_SEND2_HOOK
send2-hook: when changing fields in the compose menu
GUI manage the main index (list of emails)
Data shared between Index, Pager and Sidebar.
@ LL_DEBUG5
Log at debug level 5.
@ LL_DEBUG1
Log at debug level 1.
@ ENC_UUENCODED
UUEncoded text.
@ ENC_OTHER
Encoding unknown.
@ TYPE_OTHER
Unknown Content-Type.
@ TYPE_MULTIPART
Type: 'multipart/*'.
@ DISP_ATTACH
Content is attached.
@ DISP_INLINE
Content is inline.
struct Body * mutt_remove_multipart(struct Body *b)
Extract the multipart body if it exists.
struct Body * mutt_make_multipart(struct Body *b)
Create a multipart email.
void mutt_generate_boundary(struct ParameterList *pl)
Create a unique boundary id for a MIME part.
Convenience wrapper for the library headers.
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
const char * mutt_path_basename(const char *path)
Find the last component for a pathname.
struct Regex * mutt_regex_new(const char *str, uint32_t flags, struct Buffer *err)
Create an Regex from a string.
void mutt_regex_free(struct Regex **ptr)
Free a Regex object.
bool mutt_regex_match(const struct Regex *regex, const char *str)
Shorthand to mutt_regex_capture()
char * mutt_str_dup(const char *str)
Copy a string, safely.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Many unsorted constants and some structs.
#define MUTT_COMP_NO_FLAGS
No flags are set.
bool mutt_edit_attachment(struct Body *b)
Edit an attachment.
int mutt_get_tmp_attachment(struct Body *b)
Get a temporary copy of an attachment.
int mutt_compose_attachment(struct Body *b)
Create an attachment.
int mutt_view_attachment(FILE *fp, struct Body *b, enum ViewAttachMode mode, struct Email *e, struct AttachCtx *actx, struct MuttWindow *win)
View an attachment.
void mutt_save_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, struct Body *b, struct Email *e, struct Menu *menu)
Save a list of attachments.
ViewAttachMode
Options for mutt_view_attachment()
@ MUTT_VA_MAILCAP
Force viewing using mailcap entry.
@ MUTT_VA_REGULAR
View using default method.
@ MUTT_VA_PAGER
View attachment in pager using copiousoutput mailcap.
@ MUTT_VA_AS_TEXT
Force viewing as text.
int mutt_attach_display_loop(struct ConfigSubset *sub, struct Menu *menu, int op, struct Email *e, struct AttachCtx *actx, bool recv)
Event loop for the Attachment menu.
void mutt_pipe_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, struct Body *b, bool filter)
Pipe a list of attachments to a command.
void mutt_print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, struct Body *b)
Print a list of Attachments.
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
void mutt_window_free(struct MuttWindow **ptr)
Free a Window and its children.
bool mutt_is_text_part(const struct Body *b)
Is this part of an email in plain text?
void buf_pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using '~' or '='.
void buf_expand_path(struct Buffer *buf)
Create the canonical path.
Some miscellaneous functions.
bool message_is_tagged(struct Email *e)
Is a message in the index tagged (and within limit)
void mx_fastclose_mailbox(struct Mailbox *m, bool keep_account)
Free up memory associated with the Mailbox.
bool mx_mbox_open(struct Mailbox *m, OpenMailboxFlags flags)
Open a mailbox and parse it.
enum MailboxType mx_path_probe(const char *path)
Find a mailbox that understands a path.
struct Mailbox * mx_path_resolve(const char *path)
Get a Mailbox for a path.
enum MxStatus mx_mbox_close(struct Mailbox *m)
Save changes and close mailbox.
#define MUTT_READONLY
Open in read-only mode.
API for encryption/signing of emails.
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Nntp-specific Account data.
Usenet network mailbox type; talk to an NNTP server.
void nntp_expand_path(char *buf, size_t buflen, struct ConnAccount *acct)
Make fully qualified url from newsgroup name.
struct NntpAccountData * CurrentNewsSrv
Current NNTP news server.
struct NntpAccountData * nntp_select_server(struct Mailbox *m, const char *server, bool leave_lock)
Open a connection to an NNTP server.
@ NT_EMAIL
Email has changed, NotifyEmail, EventEmail.
const char * opcodes_get_name(int op)
Get the name of an opcode.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Prototypes for many functions.
int mutt_system(const char *cmd)
Run an external command.
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_yesorno_help(const char *prompt, enum QuadOption def, struct ConfigSubset *sub, const char *name)
Ask the user a Yes/No question offering help.
enum QuadOption query_quadoption(const char *prompt, struct ConfigSubset *sub, const char *name)
Ask the user a quad-question.
enum QuadOption query_yesorno(const char *prompt, enum QuadOption def)
Ask the user a Yes/No question.
void mutt_rand_base32(char *buf, size_t buflen)
Fill a buffer with a base32-encoded random string.
struct AttachPtr * current_attachment(struct AttachCtx *actx, struct Menu *menu)
Get the current attachment.
void mutt_update_tree(struct AttachCtx *actx)
Refresh the list of attachments.
int ba_add_tagged(struct BodyArray *ba, struct AttachCtx *actx, struct Menu *menu)
Get an array of tagged Attachments.
void mutt_rfc3676_space_unstuff(struct Email *e)
Remove RFC3676 space stuffing.
void mutt_rfc3676_space_stuff(struct Email *e)
Perform RFC3676 space stuffing on an Email.
RFC3676 Format Flowed routines.
Convenience wrapper for the send headers.
void mutt_update_encoding(struct Body *b, struct ConfigSubset *sub)
Update the encoding type.
struct Body * mutt_make_file_attach(const char *path, struct ConfigSubset *sub)
Create a file attachment.
struct Body * mutt_make_message_attach(struct Mailbox *m, struct Email *e, bool attach_msg, struct ConfigSubset *sub)
Create a message attachment.
int mutt_write_fcc(const char *path, struct Email *e, const char *msgid, bool post, const char *fcc, char **finalpath, struct ConfigSubset *sub)
Write email to FCC mailbox.
void mutt_stamp_attachment(struct Body *b)
Timestamp an Attachment.
SortType
Methods for sorting.
short vcount
The number of virtual attachments.
struct AttachPtr ** idx
Array of attachments.
short idxlen
Number of attachmentes.
An email to which things will be attached.
struct Body * body
Attachment.
char * tree
Tree characters to display.
int level
Nesting depth of attachment.
bool unowned
Don't unlink on detach.
int parent_type
Type of parent attachment, e.g. TYPE_MULTIPART.
char * language
content-language (RFC8255)
char * content_id
Content-Id (RFC2392)
char * d_filename
filename to be used for the content-disposition header If NULL, filename is used instead.
struct Body * parts
parts of a multipart or message/rfc822
bool noconv
Don't do character set conversion.
bool unlink
If true, filename should be unlink()ed before free()ing this structure.
time_t stamp
Time stamp of last encoding update.
struct ParameterList parameter
Parameters of the content-type.
struct AttachPtr * aptr
Menu information, used in recvattach.c.
struct Email * email
header information for message/rfc822
char * description
content-description
unsigned int disposition
content-disposition, ContentDisposition
bool tagged
This attachment is tagged.
struct Body * next
next attachment in the list
char * subtype
content-type subtype
unsigned int encoding
content-transfer-encoding, ContentEncoding
unsigned int type
content-type primary type, ContentType
char * filename
When sending a message, this is the file to which this structure refers.
String manipulation buffer.
size_t dsize
Length of data.
char * data
Pointer to data.
struct Menu * menu
Menu displaying the attachments.
struct AttachCtx * actx
Set of attachments.
int op
Op code, e.g. OP_COMPOSE_WRITE_MESSAGE.
compose_function_t function
Function to call.
struct ConfigSubset * sub
Config set to use.
struct Mailbox * mailbox
Current Mailbox.
int flags
Flags, e.g. MUTT_COMPOSE_NOFREEHEADER.
bool fcc_set
User has edited the Fcc: field.
int rc
Return code to leave compose.
struct ComposeAttachData * adata
Attachments.
struct Email * email
Email being composed.
struct Buffer * fcc
Buffer to save FCC.
A set of inherited config items.
struct ConnAccount account
Account details: username, password, etc.
The envelope/body of an email.
struct Envelope * env
Envelope information.
struct Body * body
List of MIME parts.
struct Notify * notify
Notifications: NotifyEmail, EventEmail.
Input for the file completion function.
Data shared between Index, Pager and Sidebar.
bool attach_msg
Are we in "attach message" mode?
int msg_count
Total number of messages.
enum MailboxType type
Mailbox type.
struct Email ** emails
Array of Emails.
bool readonly
Don't allow changes to the mailbox.
void * wdata
Private data.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
struct Connection * conn
Connection to NNTP Server.
Cached regular expression.
int cs_subset_str_native_set(const struct ConfigSubset *sub, const char *name, intptr_t value, struct Buffer *err)
Natively set the value of a string config item.