81 {
"attach-file", OP_ATTACH_ATTACH_FILE },
82 {
"attach-key", OP_ATTACH_ATTACH_KEY },
83 {
"attach-message", OP_ATTACH_ATTACH_MESSAGE },
84 {
"attach-news-message", OP_ATTACH_ATTACH_NEWS_MESSAGE },
86 {
"autocrypt-menu", OP_COMPOSE_AUTOCRYPT_MENU },
88 {
"copy-file", OP_ATTACH_SAVE },
89 {
"detach-file", OP_ATTACH_DETACH },
90 {
"display-toggle-weed", OP_DISPLAY_HEADERS },
91 {
"edit-bcc", OP_ENVELOPE_EDIT_BCC },
92 {
"edit-cc", OP_ENVELOPE_EDIT_CC },
93 {
"edit-content-id", OP_ATTACH_EDIT_CONTENT_ID },
94 {
"edit-description", OP_ATTACH_EDIT_DESCRIPTION },
95 {
"edit-encoding", OP_ATTACH_EDIT_ENCODING },
96 {
"edit-fcc", OP_ENVELOPE_EDIT_FCC },
97 {
"edit-file", OP_COMPOSE_EDIT_FILE },
98 {
"edit-followup-to", OP_ENVELOPE_EDIT_FOLLOWUP_TO },
99 {
"edit-from", OP_ENVELOPE_EDIT_FROM },
100 {
"edit-headers", OP_ENVELOPE_EDIT_HEADERS },
101 {
"edit-language", OP_ATTACH_EDIT_LANGUAGE },
102 {
"edit-message", OP_COMPOSE_EDIT_MESSAGE },
103 {
"edit-mime", OP_ATTACH_EDIT_MIME },
104 {
"edit-newsgroups", OP_ENVELOPE_EDIT_NEWSGROUPS },
105 {
"edit-reply-to", OP_ENVELOPE_EDIT_REPLY_TO },
106 {
"edit-subject", OP_ENVELOPE_EDIT_SUBJECT },
107 {
"edit-to", OP_ENVELOPE_EDIT_TO },
108 {
"edit-type", OP_ATTACH_EDIT_TYPE },
109 {
"edit-x-comment-to", OP_ENVELOPE_EDIT_X_COMMENT_TO },
111 {
"filter-entry", OP_ATTACH_FILTER },
112 {
"forget-passphrase", OP_FORGET_PASSPHRASE },
113 {
"get-attachment", OP_ATTACH_GET_ATTACHMENT },
114 {
"group-alternatives", OP_ATTACH_GROUP_ALTS },
115 {
"group-multilingual", OP_ATTACH_GROUP_LINGUAL },
116 {
"group-related", OP_ATTACH_GROUP_RELATED },
117 {
"ispell", OP_COMPOSE_ISPELL },
118 {
"move-down", OP_ATTACH_MOVE_DOWN },
119 {
"move-up", OP_ATTACH_MOVE_UP },
120 {
"new-mime", OP_ATTACH_NEW_MIME },
121 {
"pgp-menu", OP_COMPOSE_PGP_MENU },
122 {
"pipe-entry", OP_PIPE },
123 {
"pipe-message", OP_PIPE },
124 {
"postpone-message", OP_COMPOSE_POSTPONE_MESSAGE },
125 {
"preview-page-down", OP_PREVIEW_PAGE_DOWN },
126 {
"preview-page-up", OP_PREVIEW_PAGE_UP },
127 {
"print-entry", OP_ATTACH_PRINT },
128 {
"rename-attachment", OP_ATTACH_RENAME_ATTACHMENT },
129 {
"rename-file", OP_COMPOSE_RENAME_FILE },
130 {
"send-message", OP_COMPOSE_SEND_MESSAGE },
131 {
"smime-menu", OP_COMPOSE_SMIME_MENU },
132 {
"toggle-disposition", OP_ATTACH_TOGGLE_DISPOSITION },
133 {
"toggle-recode", OP_ATTACH_TOGGLE_RECODE },
134 {
"toggle-unlink", OP_ATTACH_TOGGLE_UNLINK },
135 {
"ungroup-attachment", OP_ATTACH_UNGROUP },
136 {
"update-encoding", OP_ATTACH_UPDATE_ENCODING },
137 {
"view-attach", OP_ATTACH_VIEW },
138 {
"view-mailcap", OP_ATTACH_VIEW_MAILCAP },
139 {
"view-pager", OP_ATTACH_VIEW_PAGER },
140 {
"view-text", OP_ATTACH_VIEW_TEXT },
141 {
"write-fcc", OP_COMPOSE_WRITE_MESSAGE },
149 { OP_ATTACH_ATTACH_FILE,
"a" },
150 { OP_ATTACH_ATTACH_KEY,
"\033k" },
151 { OP_ATTACH_ATTACH_MESSAGE,
"A" },
152 { OP_ATTACH_DETACH,
"D" },
153 { OP_ATTACH_EDIT_CONTENT_ID,
"\033i" },
154 { OP_ATTACH_EDIT_DESCRIPTION,
"d" },
155 { OP_ATTACH_EDIT_ENCODING,
"\005" },
156 { OP_ATTACH_EDIT_LANGUAGE,
"\014" },
157 { OP_ATTACH_EDIT_MIME,
"m" },
158 { OP_ATTACH_EDIT_TYPE,
"\024" },
159 { OP_ATTACH_FILTER,
"F" },
160 { OP_ATTACH_GET_ATTACHMENT,
"G" },
161 { OP_ATTACH_GROUP_ALTS,
"&" },
162 { OP_ATTACH_GROUP_LINGUAL,
"^" },
163 { OP_ATTACH_GROUP_RELATED,
"%" },
164 { OP_ATTACH_MOVE_DOWN,
"+" },
165 { OP_ATTACH_MOVE_UP,
"-" },
166 { OP_ATTACH_NEW_MIME,
"n" },
169 { OP_ATTACH_PRINT,
"l" },
170 { OP_ATTACH_RENAME_ATTACHMENT,
"\017" },
171 { OP_ATTACH_SAVE,
"C" },
172 { OP_ATTACH_TOGGLE_DISPOSITION,
"\004" },
173 { OP_ATTACH_TOGGLE_UNLINK,
"u" },
174 { OP_ATTACH_UNGROUP,
"#" },
175 { OP_ATTACH_UPDATE_ENCODING,
"U" },
176 { OP_ATTACH_VIEW,
"<keypadenter>" },
177 { OP_ATTACH_VIEW,
"\n" },
178 { OP_ATTACH_VIEW,
"\r" },
180 { OP_COMPOSE_AUTOCRYPT_MENU,
"o" },
182 { OP_COMPOSE_EDIT_FILE,
"\033e" },
183 { OP_COMPOSE_EDIT_MESSAGE,
"e" },
184 { OP_COMPOSE_ISPELL,
"i" },
185 { OP_COMPOSE_PGP_MENU,
"p" },
186 { OP_COMPOSE_POSTPONE_MESSAGE,
"P" },
187 { OP_COMPOSE_RENAME_FILE,
"R" },
188 { OP_COMPOSE_SEND_MESSAGE,
"y" },
189 { OP_COMPOSE_SMIME_MENU,
"S" },
190 { OP_COMPOSE_WRITE_MESSAGE,
"w" },
191 { OP_DISPLAY_HEADERS,
"h" },
192 { OP_ENVELOPE_EDIT_BCC,
"b" },
193 { OP_ENVELOPE_EDIT_CC,
"c" },
194 { OP_ENVELOPE_EDIT_FCC,
"f" },
195 { OP_ENVELOPE_EDIT_FROM,
"\033f" },
196 { OP_ENVELOPE_EDIT_HEADERS,
"E" },
197 { OP_ENVELOPE_EDIT_REPLY_TO,
"r" },
198 { OP_ENVELOPE_EDIT_SUBJECT,
"s" },
199 { OP_ENVELOPE_EDIT_TO,
"t" },
200 { OP_PREVIEW_PAGE_DOWN,
"<pagedown>" },
201 { OP_PREVIEW_PAGE_UP,
"<pageup>" },
202 { OP_FORGET_PASSPHRASE,
"\006" },
265 static const char *check =
"^[-\\.0-9@A-Z_a-z]+$";
286 struct stat st = { 0 };
287 struct Buffer *pretty = NULL, *msg = NULL;
289 for (
int i = 0; i < actx->
idxlen; i++)
320 buf_printf(msg,
_(
"Attachment #%d modified. Update encoding for %s?"),
348 if (!actx || (aidx < 0) || (aidx >= actx->
idxlen))
352 struct Body *b_previous = NULL;
353 struct Body *b_parent = NULL;
360 mutt_error(
_(
"You may not delete the only attachment"));
372 "compose_confirm_detach_first");
381 if (idx[aidx]->level > 0)
387 mutt_error(
_(
"Can't leave group with only one attachment"));
404 if (aidx < (actx->
idxlen - 1))
414 for (
int i = 0; i < part_count; i++)
416 FREE(&idx[aidx + i]->tree);
417 FREE(&idx[aidx + i]);
421 for (
int i = aidx; i < (actx->
idxlen - part_count); i++)
422 idx[i] = idx[i + part_count];
423 for (
int i = 0; i < part_count; i++)
424 idx[actx->
idxlen - i - 1] = NULL;
425 actx->
idxlen -= part_count;
439 for (
int i = actx->
idxlen; i > 0; i--)
480 struct Body *b_previous = NULL;
481 struct Body *b_parent = NULL;
486 b_previous->
next = idx[second]->
body;
498 for (
int i = second; i > first; i--)
509 int destidx = i - second + first;
510 for (
int j = i; j > destidx; j--)
512 idx[destidx] = saved;
530 int group_level = -1;
531 struct Body *bptr_parent = NULL;
534 for (
int i = 0; i < actx->
idxlen; i++)
539 if (group_level == -1)
545 if (group_level != actx->
idx[i]->
level)
547 mutt_error(
_(
"Attachments to be grouped must have the same parent"));
556 struct Body *bptr_test = NULL;
559 if (bptr_test != bptr_parent)
561 mutt_error(
_(
"Attachments to be grouped must have the same parent"));
579 mutt_error(
_(
"Can't leave group with only one attachment"));
589 struct Body *bptr_first = NULL;
590 struct Body *bptr = NULL;
591 struct Body *group_parent = NULL;
592 struct Body *group_previous = NULL;
593 struct Body *group_part = NULL;
595 int group_last_idx = 0;
598 for (
int i = 0; i < actx->
idxlen; i++)
630 struct Body *bptr_previous = NULL;
641 group_part->
next = bptr;
642 group_part = group_part->
next;
643 group_part->
next = NULL;
647 for (
int j = i + 1; j < (i + bptr_attachments); j++)
649 if (i > (group_last_idx + 1))
651 for (
int j = 0; j < bptr_attachments; j++)
653 struct AttachPtr *saved = actx->
idx[i + bptr_attachments - 1];
654 for (
int k = i + bptr_attachments - 1; k > (group_last_idx + 1); k--)
655 actx->
idx[k] = actx->
idx[k - 1];
656 actx->
idx[group_last_idx + 1] = saved;
659 i += bptr_attachments - 1;
660 group_last_idx += bptr_attachments;
667 group_part->
next = NULL;
669 for (
int j = i + 1; j < (i + bptr_attachments); j++)
671 i += bptr_attachments - 1;
688 struct Body *b = NULL;
689 struct Body *b_parent = NULL;
690 while (next_aidx < actx->idxlen)
692 b = actx->
idx[next_aidx]->
body;
696 if (group_parent == b_parent)
705 else if (next_aidx < actx->idxlen)
713 group_previous->
next = group;
714 else if (group_parent)
715 group_parent->
parts = group;
720 group_ap->
body = group;
722 group_ap->
level = group_level;
747 char *prompt =
_(
"Attach file");
752 if ((
mw_enter_fname(prompt, fname,
false, NULL,
true, &files, &numfiles,
756 for (
int i = 0; i < numfiles; i++)
765 bool added_attachment =
false;
769 "Attaching selected files...", numfiles));
771 for (
int i = 0; i < numfiles; i++)
773 char *att = files[i];
782 added_attachment =
true;
802 if (added_attachment)
841 char *prompt =
_(
"Open mailbox to attach message from");
844 const int op =
event->op;
845 if (shared->
mailbox && (op == OP_ATTACH_ATTACH_NEWS_MESSAGE))
852 prompt =
_(
"Open newsgroup to attach message from");
902 const bool old_readonly = m_attach->
readonly;
923 const unsigned char old_use_threads =
cs_subset_enum(shared->
sub,
"use_threads");
945 bool added_attachment =
false;
946 for (
int i = 0; i < m_attach_new->
msg_count; i++)
948 if (!m_attach_new->
emails[i])
958 added_attachment =
true;
969 if (m_attach_new == m_attach)
980 if (added_attachment)
1004 for (
int i = 0; i < actx->
idxlen; i++)
1061 mutt_error(
_(
"Content-ID can only contain the characters: -.0-9@A-Z_a-z"));
1243 mutt_error(
_(
"Can't filter multipart attachments"));
1247 const int op =
event->op;
1249 (op == OP_ATTACH_FILTER));
1250 if (op == OP_ATTACH_FILTER)
1276 struct Body **bp = NULL;
1303 mutt_error(
_(
"Grouping 'alternatives' requires at least 2 tagged messages"));
1318 mutt_error(
_(
"Grouping 'multilingual' requires at least 2 tagged messages"));
1323 int tagged_with_lang_num = 0;
1325 if (b->tagged && b->language && *b->language)
1326 tagged_with_lang_num++;
1330 if (
query_yesorno(
_(
"Not all parts have 'Content-Language' set, continue?"),
1349 mutt_error(
_(
"Grouping 'related' requires at least 2 tagged messages"));
1380 if (index == (actx->
idxlen - 1))
1388 mutt_error(
_(
"Attachment can't be moved out of group"));
1393 int nextidx = index + 1;
1394 while ((nextidx < actx->
idxlen) &&
1399 if (nextidx == actx->
idxlen)
1406 int finalidx = index + 1;
1407 if (nextidx < actx->
idxlen - 1)
1442 mutt_error(
_(
"Attachment can't be moved out of group"));
1447 int previdx = index - 1;
1448 while ((previdx > 0) && (actx->
idx[previdx]->
level > actx->
idx[index]->
level))
1466 struct Buffer *type = NULL;
1490 mutt_error(
_(
"Content-Type is of the form base/sub"));
1554 mutt_error(
_(
"Can't print multipart attachments"));
1581 int rc =
mw_get_field(
_(
"Send attachment with name: "), fname,
1606 mutt_error(
_(
"Can't save multipart attachments"));
1646 mutt_error(
_(
"Recoding only affects text attachments"));
1651 mutt_message(
_(
"The current attachment won't be converted"));
1653 mutt_message(
_(
"The current attachment will be converted"));
1691 struct Body *b_previous = NULL;
1692 struct Body *b_parent = NULL;
1694 int level = actx->
idx[aidx]->
level;
1706 while ((i < actx->idxlen) && (actx->
idx[i]->
level > level))
1728 for (
int j = aidx; j < (actx->
idxlen - 1); j++)
1729 actx->
idx[j] = actx->
idx[j + 1];
1755 struct Body **bp = NULL;
1780 const char *tag = NULL;
1787 while (b && b->
parts)
1833 mutt_error(
_(
"Can't edit multipart attachments"));
1853 if (!c_edit_headers)
1921 mutt_error(
_(
"Can't rename multipart attachments"));
1932 struct stat st = { 0 };
1951 if (cur_att->
body->
stamp >= st.st_mtime)
1976 shared->
sub,
"copy");
2013 NULL, shared->
sub) == 0)
2040 const int op =
event->op;
2043 case OP_ATTACH_VIEW:
2044 case OP_DISPLAY_HEADERS:
2047 case OP_ATTACH_VIEW_MAILCAP:
2051 case OP_ATTACH_VIEW_PAGER:
2055 case OP_ATTACH_VIEW_TEXT:
2084 shared->
sub,
"postpone");
2183 if (!event || !dlg || !dlg->
wdata)
2186 const int op =
event->op;
#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".
@ CMD_SEND2_HOOK
:send2-hook
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.
static 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.
struct MenuDefinition * MdCompose
Compose Menu Definition.
static int check_attachments(struct AttachCtx *actx, struct ConfigSubset *sub)
Check if any attachments have changed or been deleted.
static const struct MenuOpSeq ComposeDefaultBindings[]
Key bindings for the Compose Menu.
static int delete_attachment(struct AttachCtx *actx, int aidx)
Delete an attachment.
void compose_init_keys(struct SubMenu *sm_generic)
Initialise the Compose Keybindings - Implements ::init_keys_api.
GUI editor for an email's headers.
#define MUTT_COMPOSE_NOFREEHEADER
Don't free the header when closing compose dialog.
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.
#define MUTT_COMP_NO_FLAGS
No flags are set.
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.
EmailSortType
Methods for sorting Emails.
@ 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.
bool mutt_file_touch(const char *path)
Make sure a file exists.
void buf_quote_filename(struct Buffer *buf, const char *filename, bool add_outer)
Quote a filename to survive the shell's quoting rules.
int mutt_file_rename(const char *oldfile, const char *newfile)
Rename a file.
bool OptNews
(pseudo) used to change reader mode
static int op_exit(struct AliasMenuData *mdata, const struct KeyEvent *event)
exit this menu - Implements alias_function_t -
static int op_attach_print(struct AttachPrivateData *priv, const struct KeyEvent *event)
print the current entry - Implements attach_function_t -
static int op_forget_passphrase(struct AttachPrivateData *priv, const struct KeyEvent *event)
wipe passphrases from memory - Implements attach_function_t -
static int op_attach_save(struct AttachPrivateData *priv, const struct KeyEvent *event)
save message/attachment to a mailbox/file - Implements attach_function_t -
static int op_attach_edit_type(struct AttachPrivateData *priv, const struct KeyEvent *event)
edit attachment content type - Implements attach_function_t -
static int op_attach_group_related(struct ComposeSharedData *shared, const struct KeyEvent *event)
Group tagged attachments as 'multipart/related' - Implements compose_function_t -.
static int op_attach_attach_file(struct ComposeSharedData *shared, const struct KeyEvent *event)
Attach files to this message - Implements compose_function_t -.
static int op_display_headers(struct ComposeSharedData *shared, const struct KeyEvent *event)
Display message and toggle header weeding - Implements compose_function_t -.
static int op_attach_edit_language(struct ComposeSharedData *shared, const struct KeyEvent *event)
Edit the 'Content-Language' of the attachment - Implements compose_function_t -.
static int op_attach_detach(struct ComposeSharedData *shared, const struct KeyEvent *event)
Delete the current entry - Implements compose_function_t -.
static int op_attach_edit_content_id(struct ComposeSharedData *shared, const struct KeyEvent *event)
Edit the 'Content-ID' of the attachment - Implements compose_function_t -.
static int op_compose_ispell(struct ComposeSharedData *shared, const struct KeyEvent *event)
Run ispell on the message - Implements compose_function_t -.
static int op_attach_filter(struct ComposeSharedData *shared, const struct KeyEvent *event)
Filter attachment through a shell command - Implements compose_function_t -.
static int op_attach_edit_encoding(struct ComposeSharedData *shared, const struct KeyEvent *event)
Edit attachment transfer-encoding - Implements compose_function_t -.
static int op_attach_ungroup(struct ComposeSharedData *shared, const struct KeyEvent *event)
Ungroup a 'multipart' attachment - Implements compose_function_t -.
static int op_attach_group_alts(struct ComposeSharedData *shared, const struct KeyEvent *event)
Group tagged attachments as 'multipart/alternative' - Implements compose_function_t -.
static int op_attach_move_up(struct ComposeSharedData *shared, const struct KeyEvent *event)
Move an attachment up in the attachment list - Implements compose_function_t -.
static int op_compose_rename_file(struct ComposeSharedData *shared, const struct KeyEvent *event)
Rename/move an attached file - Implements compose_function_t -.
static int op_envelope_edit_headers(struct ComposeSharedData *shared, const struct KeyEvent *event)
Edit the message with headers - Implements compose_function_t -.
static int op_compose_postpone_message(struct ComposeSharedData *shared, const struct KeyEvent *event)
Save this message to send later - Implements compose_function_t -.
static int op_attach_toggle_recode(struct ComposeSharedData *shared, const struct KeyEvent *event)
Toggle recoding of this attachment - Implements compose_function_t -.
static int op_compose_write_message(struct ComposeSharedData *shared, const struct KeyEvent *event)
Write the message to a folder - Implements compose_function_t -.
static int op_attach_group_lingual(struct ComposeSharedData *shared, const struct KeyEvent *event)
Group tagged attachments as 'multipart/multilingual' - Implements compose_function_t -.
static int op_attach_move_down(struct ComposeSharedData *shared, const struct KeyEvent *event)
Move an attachment down in the attachment list - Implements compose_function_t -.
static int op_attach_toggle_disposition(struct ComposeSharedData *shared, const struct KeyEvent *event)
Toggle disposition between inline/attachment - Implements compose_function_t -.
static int op_compose_send_message(struct ComposeSharedData *shared, const struct KeyEvent *event)
Send the message - Implements compose_function_t -.
static int op_attach_rename_attachment(struct ComposeSharedData *shared, const struct KeyEvent *event)
Send attachment with a different name - Implements compose_function_t -.
static int op_attach_attach_message(struct ComposeSharedData *shared, const struct KeyEvent *event)
Attach messages to this message - Implements compose_function_t -.
static int op_attach_edit_description(struct ComposeSharedData *shared, const struct KeyEvent *event)
Edit attachment description - Implements compose_function_t -.
static int op_attach_update_encoding(struct ComposeSharedData *shared, const struct KeyEvent *event)
Update an attachment's encoding info - Implements compose_function_t -.
static int op_attach_toggle_unlink(struct ComposeSharedData *shared, const struct KeyEvent *event)
Toggle whether to delete file after sending it - Implements compose_function_t -.
static int op_attach_new_mime(struct ComposeSharedData *shared, const struct KeyEvent *event)
Compose new attachment using mailcap entry - Implements compose_function_t -.
static int op_attach_edit_mime(struct ComposeSharedData *shared, const struct KeyEvent *event)
Edit attachment using mailcap entry - Implements compose_function_t -.
static int op_compose_edit_message(struct ComposeSharedData *shared, const struct KeyEvent *event)
Edit the message - Implements compose_function_t -.
static int op_attach_get_attachment(struct ComposeSharedData *shared, const struct KeyEvent *event)
Get a temporary copy of an attachment - Implements compose_function_t -.
static int op_compose_edit_file(struct ComposeSharedData *shared, const struct KeyEvent *event)
Edit the file to be attached - Implements compose_function_t -.
static int op_attach_attach_key(struct ComposeSharedData *shared, const struct KeyEvent *event)
Attach a PGP public key - Implements compose_function_t -.
int compose_function_dispatcher(struct MuttWindow *win, const struct KeyEvent *event)
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?
enum MailboxType pop_path_probe(const char *path, const struct stat *st)
Is this a POP Mailbox?
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox?
Convenience wrapper for the gui headers.
Read/write command history from/to a file.
@ HC_OTHER
Miscellaneous strings.
void exec_message_hook(struct Mailbox *m, struct Email *e, enum CommandId id)
Perform a message hook.
GUI manage the main index (list of emails)
void km_menu_add_submenu(struct MenuDefinition *md, struct SubMenu *sm)
Add a SubMenu to a Menu Definition.
struct SubMenu * km_register_submenu(const struct MenuFuncOp functions[])
Register a submenu.
struct MenuDefinition * km_register_menu(int menu, const char *name)
Register a menu.
void km_menu_add_bindings(struct MenuDefinition *md, const struct MenuOpSeq bindings[])
Add Keybindings to a Menu.
@ LL_DEBUG5
Log at debug level 5.
@ LL_DEBUG1
Log at debug level 1.
#define FREE(x)
Free memory and set the pointer to NULL.
@ 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.
#define ENCODING(x)
Get the encoding name for an encoding type.
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.
int mutt_system(const char *cmd)
Run an external command.
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 pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using '~' or '='.
void expand_path(struct Buffer *buf, bool regex)
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.
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.
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.
#define MUTT_RANDTAG_LEN
Length of random tag for message boundaries.
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.
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?
An event such as a keypress.
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.
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.
@ MENU_COMPOSE
Compose an email.