53 "Function not permitted in attach-message mode");
60 {
"bounce-message", OP_BOUNCE_MESSAGE },
61 {
"check-traditional-pgp", OP_CHECK_TRADITIONAL },
62 {
"collapse-parts", OP_ATTACH_COLLAPSE },
63 {
"compose-to-sender", OP_COMPOSE_TO_SENDER },
64 {
"delete-entry", OP_ATTACH_DELETE },
65 {
"display-toggle-weed", OP_DISPLAY_HEADERS },
66 {
"edit-type", OP_ATTACH_EDIT_TYPE },
68 {
"extract-keys", OP_EXTRACT_KEYS },
69 {
"followup-message", OP_FOLLOWUP },
70 {
"forget-passphrase", OP_FORGET_PASSPHRASE },
71 {
"forward-message", OP_FORWARD_MESSAGE },
72 {
"forward-to-group", OP_FORWARD_TO_GROUP },
73 {
"group-chat-reply", OP_GROUP_CHAT_REPLY },
74 {
"group-reply", OP_GROUP_REPLY },
75 {
"list-reply", OP_LIST_REPLY },
76 {
"list-subscribe", OP_LIST_SUBSCRIBE },
77 {
"list-unsubscribe", OP_LIST_UNSUBSCRIBE },
78 {
"pipe-entry", OP_PIPE },
79 {
"pipe-message", OP_PIPE },
80 {
"print-entry", OP_ATTACH_PRINT },
81 {
"reply", OP_REPLY },
82 {
"resend-message", OP_RESEND },
83 {
"save-entry", OP_ATTACH_SAVE },
84 {
"undelete-entry", OP_ATTACH_UNDELETE },
85 {
"view-attach", OP_ATTACH_VIEW },
86 {
"view-mailcap", OP_ATTACH_VIEW_MAILCAP },
87 {
"view-pager", OP_ATTACH_VIEW_PAGER },
88 {
"view-text", OP_ATTACH_VIEW_TEXT },
96 { OP_ATTACH_COLLAPSE,
"v" },
97 { OP_ATTACH_DELETE,
"d" },
98 { OP_ATTACH_EDIT_TYPE,
"\005" },
101 { OP_ATTACH_PRINT,
"p" },
102 { OP_ATTACH_SAVE,
"s" },
103 { OP_ATTACH_UNDELETE,
"u" },
104 { OP_ATTACH_VIEW,
"<keypadenter>" },
105 { OP_ATTACH_VIEW,
"\n" },
106 { OP_ATTACH_VIEW,
"\r" },
107 { OP_ATTACH_VIEW_MAILCAP,
"m" },
108 { OP_ATTACH_VIEW_TEXT,
"T" },
109 { OP_BOUNCE_MESSAGE,
"b" },
110 { OP_CHECK_TRADITIONAL,
"\033P" },
111 { OP_DISPLAY_HEADERS,
"h" },
112 { OP_EXTRACT_KEYS,
"\013" },
113 { OP_FORGET_PASSPHRASE,
"\006" },
114 { OP_FORWARD_MESSAGE,
"f" },
115 { OP_GROUP_REPLY,
"g" },
116 { OP_LIST_REPLY,
"L" },
118 { OP_RESEND,
"\033e" },
151 int rindex, curlevel;
159 curlevel = cur_att->
level;
161 rindex = actx->
v2r[index] + 1;
163 const bool c_digest_collapse =
cs_subset_bool(sub,
"digest_collapse");
164 while ((rindex < actx->idxlen) && (actx->
idx[rindex]->
level > curlevel))
274 int *num_changed,
int *num_blocked)
285 if (!ap || !ap->
body)
300 *num_changed = changed;
302 *num_blocked = blocked;
322 mutt_error(
_(
"Can't delete attachment from POP server"));
329 mutt_error(
_(
"Can't delete attachment from news server"));
335 mutt_message(
_(
"Deletion of attachments from encrypted messages is unsupported"));
340 mutt_message(
_(
"Deletion of attachments from signed messages may invalidate the signature"));
364 mutt_message(
_(
"Only deletion of multipart attachments is supported"));
377 if (c_resolve && (next < priv->menu->max))
439 if ((
ARRAY_SIZE(&aa) == 1) && c_resolve && (index < priv->menu->max))
483 if (c_resolve && (next < priv->menu->max))
705 const int op =
event->op;
707 if (
op == OP_GROUP_REPLY)
709 else if (
op == OP_GROUP_CHAT_REPLY)
711 else if (
op == OP_LIST_REPLY)
752 mutt_error(
_(
"You may only followup to message/rfc822 parts"));
833 if (!event || !dlg || !dlg->
wdata)
847 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_SIZE(head)
The number of elements stored.
#define ARRAY_FREE(head)
Release all memory.
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
void mutt_actx_free(struct AttachCtx **ptr)
Free an Attachment Context.
static const struct MenuFuncOp OpAttach[]
Functions for the Attach Menu.
static const struct MenuOpSeq AttachmentDefaultBindings[]
Key bindings for the Attachment Menu.
static bool check_attach(struct AttachPrivateData *priv)
Check if in attach-message mode.
static int recvattach_pgp_check_traditional(struct AttachPtrArray *aa)
Is the Attachment inline PGP?
static void attach_collapse(struct AttachCtx *actx, struct Menu *menu, struct ConfigSubset *sub)
Close the tree of the current attachment.
static void attach_apply_set_deleted(struct AttachPtrArray *apa, bool deleted, int *num_changed, int *num_blocked)
Apply the deleted flag to a working set of attachments.
static void recvattach_extract_pgp_keys(struct AttachPtrArray *aa)
Extract PGP keys from attachments.
static const char * Function_not_permitted_in_attach_message_mode
Error message for unavailable functions in attach mode.
void attach_init_keys(struct NeoMutt *n, struct SubMenu *sm_generic)
Initialise the Attach Keybindings - Implements ::init_keys_api.
static const struct AttachFunction AttachFunctions[]
All the NeoMutt functions that the Attach supports.
static bool check_readonly(struct Mailbox *m)
Check if the Mailbox is readonly.
Attach private Module data.
Private state data for Attachments.
Handling of email attachments.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
@ MUTT_POP
'POP3' Mailbox type
@ MUTT_NNTP
'NNTP' (Usenet) Mailbox type
void crypt_forget_passphrase(void)
Forget a passphrase and display a message.
SecurityFlags crypt_query(struct Body *b)
Check out the type of encryption used.
bool crypt_pgp_check_traditional(FILE *fp, struct Body *b, bool just_one)
Wrapper for CryptModuleSpecs::pgp_check_traditional()
void crypt_pgp_extract_key_from_attachment(FILE *fp, struct Body *b)
Wrapper for CryptModuleSpecs::pgp_extract_key_from_attachment()
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
void dispatcher_flush_on_error(int rv)
Flush pending keys after a dispatch error.
@ FR_SUCCESS
Valid function - successfully performed.
@ FR_DONE
Exit the Dialog.
@ FR_UNKNOWN
Unknown function.
@ FR_ERROR
Valid function - error occurred.
@ FR_CONTINUE
Remain in the Dialog.
@ FR_NO_ACTION
Valid function - no action performed.
Structs that make up an email.
void mutt_flushinp(void)
MacroEvents moved to KeyModuleData UngetKeyEvents moved to KeyModuleData.
static int op_exit(struct AliasFunctionData *fdata, const struct KeyEvent *event)
exit this menu - Implements alias_function_t -
static int op_attach_view_text(struct AttachFunctionData *fdata, const struct KeyEvent *event)
view attachment as text - Implements attach_function_t -
static int op_followup(struct AttachFunctionData *fdata, const struct KeyEvent *event)
followup to newsgroup - Implements attach_function_t -
static int op_list_unsubscribe(struct AttachFunctionData *fdata, const struct KeyEvent *event)
unsubscribe from a mailing list - Implements attach_function_t -
static int op_attach_edit_type(struct AttachFunctionData *fdata, const struct KeyEvent *event)
edit attachment content type - Implements attach_function_t -
static int op_resend(struct AttachFunctionData *fdata, const struct KeyEvent *event)
use the current message as a template for a new one - Implements attach_function_t -
static int op_forward_message(struct AttachFunctionData *fdata, const struct KeyEvent *event)
forward a message with comments - Implements attach_function_t -
static int op_attach_delete(struct AttachFunctionData *fdata, const struct KeyEvent *event)
delete the current entry - Implements attach_function_t -
static int op_attach_undelete(struct AttachFunctionData *fdata, const struct KeyEvent *event)
undelete the current entry - Implements attach_function_t -
static int op_attach_view(struct AttachFunctionData *fdata, const struct KeyEvent *event)
view attachment using mailcap entry if necessary - Implements attach_function_t -
static int op_attach_pipe(struct AttachFunctionData *fdata, const struct KeyEvent *event)
pipe message/attachment to a shell command - Implements attach_function_t -
static int op_compose_to_sender(struct AttachFunctionData *fdata, const struct KeyEvent *event)
compose new message to the current message sender - Implements attach_function_t -
static int op_attach_save(struct AttachFunctionData *fdata, const struct KeyEvent *event)
save message/attachment to a mailbox/file - Implements attach_function_t -
static int op_list_subscribe(struct AttachFunctionData *fdata, const struct KeyEvent *event)
subscribe to a mailing list - Implements attach_function_t -
static int op_attach_print(struct AttachFunctionData *fdata, const struct KeyEvent *event)
print the current entry - Implements attach_function_t -
static int op_attach_collapse(struct AttachFunctionData *fdata, const struct KeyEvent *event)
toggle display of subparts - Implements attach_function_t -
static int op_check_traditional(struct AttachFunctionData *fdata, const struct KeyEvent *event)
check for classic PGP - Implements attach_function_t -
static int op_extract_keys(struct AttachFunctionData *fdata, const struct KeyEvent *event)
extract supported public keys - Implements attach_function_t -
static int op_forward_to_group(struct AttachFunctionData *fdata, const struct KeyEvent *event)
forward to newsgroup - Implements attach_function_t -
static int op_reply(struct AttachFunctionData *fdata, const struct KeyEvent *event)
reply to a message - Implements attach_function_t -
static int op_bounce_message(struct AttachFunctionData *fdata, const struct KeyEvent *event)
remail a message to another user - Implements attach_function_t -
static int op_forget_passphrase(struct AttachFunctionData *fdata, const struct KeyEvent *event)
wipe passphrases from memory - Implements attach_function_t -
static int op_attach_view_mailcap(struct AttachFunctionData *fdata, const struct KeyEvent *event)
force viewing of attachment using mailcap - Implements attach_function_t -
static int op_attach_view_pager(struct AttachFunctionData *fdata, const struct KeyEvent *event)
view attachment in pager using copiousoutput mailcap - Implements attach_function_t -
int attach_function_dispatcher(struct MuttWindow *win, const struct KeyEvent *event)
Perform a Attach function - Implements function_dispatcher_t -.
#define mutt_message(...)
Convenience wrapper for the gui headers.
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.
@ TYPE_MULTIPART
Type: 'multipart/*'.
@ MODULE_ID_ATTACH
ModuleAttach, Attachments
Convenience wrapper for the library headers.
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
int mutt_view_attachment(FILE *fp, struct Body *b, enum ViewAttachMode mode, struct Email *e, struct AttachCtx *actx, struct MuttWindow *win)
View an attachment.
Handling of email attachments.
void mutt_save_attachment_list(struct AttachPtrArray *aa, struct Email *e, struct Menu *menu)
Save a list of selected attachments.
void mutt_pipe_attachment_list(struct AttachPtrArray *aa, bool filter)
Pipe selected attachments to a command.
@ MUTT_VA_MAILCAP
Force viewing using mailcap entry.
@ 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_print_attachment_list(struct AttachPtrArray *aa)
Print selected attachments.
API for encryption/signing of emails.
@ SEC_PARTSIGN
Not all parts of the email is signed.
@ SEC_SIGN
Email is signed.
@ SEC_ENCRYPT
Email is encrypted.
#define APPLICATION_PGP
Use PGP to encrypt/sign.
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
enum QuadOption query_quadoption(const char *prompt, struct ConfigSubset *sub, const char *name)
Ask the user a quad-question.
void mutt_update_recvattach_menu(struct AttachCtx *actx, struct Menu *menu, bool init)
Update the Attachment Menu.
struct AttachPtr * current_attachment(struct AttachCtx *actx, struct Menu *menu)
Get the current attachment.
void recvattach_edit_content_type(struct AttachCtx *actx, struct Menu *menu, struct Email *e)
Edit the content type of an attachment.
Routines for managing attachments.
int aa_add_selection(struct AttachPtrArray *aa, struct AttachCtx *actx, struct Menu *menu, bool use_tagged, int count)
Build a working set of Attachments for an action.
void mutt_attach_mail_sender(struct AttachPtrArray *aa)
Compose an email to the sender in the email attachment.
void mutt_attach_reply(struct AttachPtrArray *aa, struct Mailbox *m, struct Email *e, struct AttachCtx *actx, SendFlags flags)
Attach a reply.
void mutt_attach_resend(struct AttachPtrArray *aa, struct Mailbox *m)
Resend-message, from the attachment menu.
void attach_bounce_message(struct AttachPtrArray *aa, struct Mailbox *m)
Bounce function, from the attachment menu.
void mutt_attach_forward(struct AttachPtrArray *aa, struct Email *e, struct AttachCtx *actx, SendFlags flags)
Forward selected attachments.
Send/reply with an attachment.
Convenience wrapper for the send headers.
bool mutt_send_list_unsubscribe(struct Mailbox *m, struct Email *e)
Send a mailing-list unsubscription email.
bool mutt_send_list_subscribe(struct Mailbox *m, struct Email *e)
Send a mailing-list subscription email.
@ SEND_GROUP_CHAT_REPLY
Reply to all recipients preserving To/Cc.
@ SEND_REPLY
Reply to sender.
@ SEND_NONE
No flags are set.
@ SEND_GROUP_REPLY
Reply to all.
@ SEND_LIST_REPLY
Reply to mailing list.
@ SEND_NEWS
Reply to a news article.
struct Email * email
Used by recvattach for updating.
struct AttachPtr ** idx
Array of attachments.
short idxlen
Number of attachmentes.
short * v2r
Mapping from virtual to real attachment.
Data passed to Attach worker functions.
struct AttachPrivateData * priv
Attach private data.
struct NeoMutt * n
NeoMutt application data.
attach_function_t function
Function to call.
int op
Op code, e.g. OP_ATTACH_COLLAPSE.
Attach private Module data.
struct MenuDefinition * menu_attach
Attach menu definition.
Private state data for Attachments.
int op
Op returned from the Pager, e.g. OP_NEXT_ENTRY.
struct Menu * menu
Current Menu.
struct ConfigSubset * sub
Config subset.
struct AttachCtx * actx
List of all Attachments.
bool attach_msg
Are we in "attach message" mode?
struct Mailbox * mailbox
Current Mailbox.
An email to which things will be attached.
struct Body * body
Attachment.
bool collapsed
Group is collapsed.
int level
Nesting depth of attachment.
FILE * fp
Used in the recvattach menu.
int parent_type
Type of parent attachment, e.g. TYPE_MULTIPART.
struct Body * parts
parts of a multipart or message/rfc822
bool deleted
Attachment marked for deletion.
struct Email * email
header information for message/rfc822
char * subtype
content-type subtype
unsigned int type
content-type primary type, ContentType
A set of inherited config items.
struct Envelope * env
Envelope information.
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
bool changed
Email has been edited.
bool attach_del
Has an attachment marked for deletion.
char * followup_to
List of 'followup-to' fields.
An event such as a keypress.
int count
Optional count prefix, e.g. 3 for 3j
int op
Function opcode, e.g. OP_HELP.
enum MailboxType type
Mailbox type.
bool readonly
Don't allow changes to the mailbox.
void * wdata
Private data.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
@ MENU_ATTACH
Select an attachment.