NeoMutt  2025-12-11-694-ga89709
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
functions.c File Reference

Compose functions. More...

#include "config.h"
#include <errno.h>
#include <stdbool.h>
#include <string.h>
#include <sys/stat.h>
#include <unistd.h>
#include "private.h"
#include "mutt/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "conn/lib.h"
#include "gui/lib.h"
#include "mutt.h"
#include "functions.h"
#include "lib.h"
#include "attach/lib.h"
#include "browser/lib.h"
#include "editor/lib.h"
#include "history/lib.h"
#include "hooks/lib.h"
#include "imap/lib.h"
#include "index/lib.h"
#include "key/lib.h"
#include "menu/lib.h"
#include "ncrypt/lib.h"
#include "nntp/lib.h"
#include "pop/lib.h"
#include "question/lib.h"
#include "send/lib.h"
#include "attach_data.h"
#include "external.h"
#include "globals.h"
#include "mutt_logging.h"
#include "muttlib.h"
#include "mx.h"
#include "nntp/adata.h"
#include "shared_data.h"
#include <libintl.h>
+ Include dependency graph for functions.c:

Go to the source code of this file.

Functions

void compose_init_keys (struct SubMenu *sm_generic)
 Initialise the Compose Keybindings - Implements ::init_keys_api.
 
static bool check_count (struct AttachCtx *actx)
 Check if there are any attachments.
 
static char * gen_cid (void)
 Generate a random Content ID.
 
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.
 
static int delete_attachment (struct AttachCtx *actx, int aidx)
 Delete an attachment.
 
static void update_idx (struct Menu *menu, struct AttachCtx *actx, struct AttachPtr *ap)
 Add a new attachment to the message.
 
static void compose_attach_swap (struct Email *e, struct AttachCtx *actx, int first, int second)
 Swap two adjacent entries in the attachment list.
 
static int group_attachments (struct ComposeSharedData *shared, char *subtype)
 Group tagged attachments into a multipart group.
 
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_attach_attach_key (struct ComposeSharedData *shared, const struct KeyEvent *event)
 Attach a PGP public key - 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_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_attach_edit_description (struct ComposeSharedData *shared, const struct KeyEvent *event)
 Edit attachment description - 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_edit_language (struct ComposeSharedData *shared, const struct KeyEvent *event)
 Edit the 'Content-Language' of the attachment - 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_attach_edit_type (struct ComposeSharedData *shared, const struct KeyEvent *event)
 Edit attachment content type - 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_get_attachment (struct ComposeSharedData *shared, const struct KeyEvent *event)
 Get a temporary copy of an 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_group_lingual (struct ComposeSharedData *shared, const struct KeyEvent *event)
 Group tagged attachments as 'multipart/multilingual' - Implements compose_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_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_move_up (struct ComposeSharedData *shared, const struct KeyEvent *event)
 Move an attachment up in the attachment list - 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_print (struct ComposeSharedData *shared, const struct KeyEvent *event)
 Print the current entry - 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_save (struct ComposeSharedData *shared, const struct KeyEvent *event)
 Save message/attachment to a mailbox/file - 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_attach_toggle_recode (struct ComposeSharedData *shared, const struct KeyEvent *event)
 Toggle recoding of this attachment - 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_ungroup (struct ComposeSharedData *shared, const struct KeyEvent *event)
 Ungroup a 'multipart' attachment - 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_envelope_edit_headers (struct ComposeSharedData *shared, const struct KeyEvent *event)
 Edit the message with headers - 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_compose_edit_message (struct ComposeSharedData *shared, const struct KeyEvent *event)
 Edit the message - 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_compose_postpone_message (struct ComposeSharedData *shared, const struct KeyEvent *event)
 Save this message to send later - 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_compose_send_message (struct ComposeSharedData *shared, const struct KeyEvent *event)
 Send the message - 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_display_headers (struct ComposeSharedData *shared, const struct KeyEvent *event)
 Display message and toggle header weeding - Implements compose_function_t -.
 
static int op_exit (struct ComposeSharedData *shared, const struct KeyEvent *event)
 Exit this menu - Implements compose_function_t -.
 
static int op_forget_passphrase (struct ComposeSharedData *shared, const struct KeyEvent *event)
 Wipe passphrases from memory - Implements compose_function_t -.
 
int compose_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Compose function - Implements function_dispatcher_t -.
 

Variables

struct MenuDefinitionMdCompose = NULL
 Compose Menu Definition.
 
static const struct MenuFuncOp OpCompose []
 Functions for the Compose Menu.
 
static const struct MenuOpSeq ComposeDefaultBindings []
 Key bindings for the Compose Menu.
 
static const struct ComposeFunction ComposeFunctions []
 All the NeoMutt functions that the Compose supports.
 

Detailed Description

Compose functions.

Authors
  • Pietro Cerutti
  • Richard Russon
  • David Purton

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file functions.c.

Function Documentation

◆ compose_init_keys()

void compose_init_keys ( struct SubMenu * sm_generic)

Initialise the Compose Keybindings - Implements ::init_keys_api.

Definition at line 211 of file functions.c.

212{
213 struct MenuDefinition *md = NULL;
214 struct SubMenu *sm = NULL;
215
217 md = km_register_menu(MENU_COMPOSE, "compose");
218 km_menu_add_submenu(md, sm);
219 km_menu_add_submenu(md, sm_generic);
221
222 MdCompose = md;
223}
static const struct MenuFuncOp OpCompose[]
Functions for the Compose Menu.
Definition functions.c:80
struct MenuDefinition * MdCompose
Compose Menu Definition.
Definition functions.c:74
static const struct MenuOpSeq ComposeDefaultBindings[]
Key bindings for the Compose Menu.
Definition functions.c:148
void km_menu_add_submenu(struct MenuDefinition *md, struct SubMenu *sm)
Add a SubMenu to a Menu Definition.
Definition init.c:123
struct SubMenu * km_register_submenu(const struct MenuFuncOp functions[])
Register a submenu.
Definition init.c:91
struct MenuDefinition * km_register_menu(int menu, const char *name)
Register a menu.
Definition init.c:107
void km_menu_add_bindings(struct MenuDefinition *md, const struct MenuOpSeq bindings[])
Add Keybindings to a Menu.
Definition init.c:136
Functions for a Dialog or Window.
Definition menu.h:80
Collection of related functions.
Definition menu.h:68
@ MENU_COMPOSE
Compose an email.
Definition type.h:40
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_count()

static bool check_count ( struct AttachCtx * actx)
static

Check if there are any attachments.

Parameters
actxAttachment context
Return values
trueThere are attachments

Definition at line 230 of file functions.c.

231{
232 if (actx->idxlen == 0)
233 {
234 mutt_error(_("There are no attachments"));
235 return false;
236 }
237
238 return true;
239}
#define mutt_error(...)
Definition logging2.h:94
#define _(a)
Definition message.h:28
short idxlen
Number of attachmentes.
Definition attach.h:68
+ Here is the caller graph for this function:

◆ gen_cid()

static char * gen_cid ( void )
static

Generate a random Content ID.

Return values
ptrContent ID
Note
The caller should free the string

Definition at line 247 of file functions.c.

248{
249 char rndid[MUTT_RANDTAG_LEN + 1];
250
251 mutt_rand_base32(rndid, sizeof(rndid) - 1);
252 rndid[MUTT_RANDTAG_LEN] = 0;
253
254 return mutt_str_dup(rndid);
255}
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition string.c:257
void mutt_rand_base32(char *buf, size_t buflen)
Fill a buffer with a base32-encoded random string.
Definition random.c:106
#define MUTT_RANDTAG_LEN
Length of random tag for message boundaries.
Definition sendlib.h:36
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_cid()

static bool check_cid ( const char * cid)
static

Check if a Content-ID is valid.

Parameters
cidContent-ID to check
Return values
trueContent-ID is valid
falseContent-ID is not valid

Definition at line 263 of file functions.c.

264{
265 static const char *check = "^[-\\.0-9@A-Z_a-z]+$";
266
267 struct Regex *check_cid_regex = mutt_regex_new(check, 0, NULL);
268
269 const bool valid = mutt_regex_match(check_cid_regex, cid);
270
271 mutt_regex_free(&check_cid_regex);
272
273 return valid;
274}
struct Regex * mutt_regex_new(const char *str, uint32_t flags, struct Buffer *err)
Create an Regex from a string.
Definition regex.c:80
void mutt_regex_free(struct Regex **ptr)
Free a Regex object.
Definition regex.c:118
bool mutt_regex_match(const struct Regex *regex, const char *str)
Shorthand to mutt_regex_capture()
Definition regex.c:614
Cached regular expression.
Definition regex3.h:85
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_attachments()

static int check_attachments ( struct AttachCtx * actx,
struct ConfigSubset * sub )
static

Check if any attachments have changed or been deleted.

Parameters
actxAttachment context
subConfigSubset
Return values
0Success
-1Error

Definition at line 283 of file functions.c.

284{
285 int rc = -1;
286 struct stat st = { 0 };
287 struct Buffer *pretty = NULL, *msg = NULL;
288
289 for (int i = 0; i < actx->idxlen; i++)
290 {
291 if (actx->idx[i]->body->type == TYPE_MULTIPART)
292 continue;
293 if (stat(actx->idx[i]->body->filename, &st) != 0)
294 {
295 if (!pretty)
296 pretty = buf_pool_get();
297 buf_strcpy(pretty, actx->idx[i]->body->filename);
298 pretty_mailbox(pretty);
299 /* L10N: This message is displayed in the compose menu when an attachment
300 doesn't stat. %d is the attachment number and %s is the attachment
301 filename. The filename is located last to avoid a long path hiding
302 the error message. */
303 mutt_error(_("Attachment #%d no longer exists: %s"), i + 1, buf_string(pretty));
304 goto cleanup;
305 }
306
307 if (actx->idx[i]->body->stamp < st.st_mtime)
308 {
309 if (!pretty)
310 pretty = buf_pool_get();
311 buf_strcpy(pretty, actx->idx[i]->body->filename);
312 pretty_mailbox(pretty);
313
314 if (!msg)
315 msg = buf_pool_get();
316 /* L10N: This message is displayed in the compose menu when an attachment
317 is modified behind the scenes. %d is the attachment number and %s is
318 the attachment filename. The filename is located last to avoid a long
319 path hiding the prompt question. */
320 buf_printf(msg, _("Attachment #%d modified. Update encoding for %s?"),
321 i + 1, buf_string(pretty));
322
324 if (ans == MUTT_YES)
325 mutt_update_encoding(actx->idx[i]->body, sub);
326 else if (ans == MUTT_ABORT)
327 goto cleanup;
328 }
329 }
330
331 rc = 0;
332
333cleanup:
334 buf_pool_release(&pretty);
335 buf_pool_release(&msg);
336 return rc;
337}
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition buffer.c:161
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition buffer.c:395
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition buffer.h:96
@ TYPE_MULTIPART
Type: 'multipart/*'.
Definition mime.h:37
void pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using '~' or '='.
Definition muttlib.c:428
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition pool.c:91
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition pool.c:111
QuadOption
Possible values for a quad-option.
Definition quad.h:36
@ MUTT_ABORT
User aborted the question (with Ctrl-G)
Definition quad.h:37
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
Definition quad.h:39
enum QuadOption query_yesorno(const char *prompt, enum QuadOption def)
Ask the user a Yes/No question.
Definition question.c:329
void mutt_update_encoding(struct Body *b, struct ConfigSubset *sub)
Update the encoding type.
Definition sendlib.c:421
struct AttachPtr ** idx
Array of attachments.
Definition attach.h:67
struct Body * body
Attachment.
Definition attach.h:36
time_t stamp
Time stamp of last encoding update.
Definition body.h:77
unsigned int type
content-type primary type, ContentType
Definition body.h:40
char * filename
When sending a message, this is the file to which this structure refers.
Definition body.h:59
String manipulation buffer.
Definition buffer.h:36
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete_attachment()

static int delete_attachment ( struct AttachCtx * actx,
int aidx )
static

Delete an attachment.

Parameters
actxAttachment context
aidxIndex number of attachment to delete
Return values
0Success
-1Error

Definition at line 346 of file functions.c.

347{
348 if (!actx || (aidx < 0) || (aidx >= actx->idxlen))
349 return -1;
350
351 struct AttachPtr **idx = actx->idx;
352 struct Body *b_previous = NULL;
353 struct Body *b_parent = NULL;
354
355 if (aidx == 0)
356 {
357 struct Body *b = actx->idx[0]->body;
358 if (!b->next) // There's only one attachment left
359 {
360 mutt_error(_("You may not delete the only attachment"));
361 return -1;
362 }
363
364 if (cs_subset_bool(NeoMutt->sub, "compose_confirm_detach_first"))
365 {
366 /* L10N: Prompt when trying to hit <detach-file> on the first entry in
367 the compose menu. This entry is most likely the message they just
368 typed. Hitting yes will remove the entry and unlink the file, so
369 it's worth confirming they really meant to do it. */
370 enum QuadOption ans = query_yesorno_help(_("Really delete the main message?"),
372 "compose_confirm_detach_first");
373 if (ans == MUTT_NO)
374 {
375 idx[aidx]->body->tagged = false;
376 return -1;
377 }
378 }
379 }
380
381 if (idx[aidx]->level > 0)
382 {
383 if (attach_body_parent(idx[0]->body, NULL, idx[aidx]->body, &b_parent))
384 {
385 if (attach_body_count(b_parent->parts, false) < 3)
386 {
387 mutt_error(_("Can't leave group with only one attachment"));
388 return -1;
389 }
390 }
391 }
392
393 // reorder body pointers
394 if (aidx > 0)
395 {
396 if (attach_body_previous(idx[0]->body, idx[aidx]->body, &b_previous))
397 b_previous->next = idx[aidx]->body->next;
398 else if (attach_body_parent(idx[0]->body, NULL, idx[aidx]->body, &b_parent))
399 b_parent->parts = idx[aidx]->body->next;
400 }
401
402 // free memory
403 int part_count = 1;
404 if (aidx < (actx->idxlen - 1))
405 {
406 if ((idx[aidx]->body->type == TYPE_MULTIPART) &&
407 (idx[aidx + 1]->level > idx[aidx]->level))
408 {
409 part_count += attach_body_count(idx[aidx]->body->parts, true);
410 }
411 }
412 idx[aidx]->body->next = NULL;
413 mutt_body_free(&(idx[aidx]->body));
414 for (int i = 0; i < part_count; i++)
415 {
416 FREE(&idx[aidx + i]->tree);
417 FREE(&idx[aidx + i]);
418 }
419
420 // reorder attachment list
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;
426
427 return 0;
428}
bool attach_body_parent(struct Body *start, struct Body *start_parent, struct Body *body, struct Body **body_parent)
Find the parent of a body.
Definition lib.c:71
int attach_body_count(struct Body *body, bool recurse)
Count bodies.
Definition lib.c:42
bool attach_body_previous(struct Body *start, struct Body *body, struct Body **previous)
Find the previous body of a body.
Definition lib.c:142
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition helpers.c:47
void mutt_body_free(struct Body **ptr)
Free a Body.
Definition body.c:58
#define FREE(x)
Free memory and set the pointer to NULL.
Definition memory.h:68
@ MUTT_NO
User answered 'No', or assume 'No'.
Definition quad.h:38
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.
Definition question.c:357
An email to which things will be attached.
Definition attach.h:35
The body of an email.
Definition body.h:36
struct Body * parts
parts of a multipart or message/rfc822
Definition body.h:73
bool tagged
This attachment is tagged.
Definition body.h:90
struct Body * next
next attachment in the list
Definition body.h:72
Container for Accounts, Notifications.
Definition neomutt.h:41
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:49
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_idx()

static void update_idx ( struct Menu * menu,
struct AttachCtx * actx,
struct AttachPtr * ap )
static

Add a new attachment to the message.

Parameters
menuCurrent menu
actxAttachment context
apAttachment to add

Definition at line 436 of file functions.c.

437{
438 ap->level = 0;
439 for (int i = actx->idxlen; i > 0; i--)
440 {
441 if (ap->level == actx->idx[i - 1]->level)
442 {
443 actx->idx[i - 1]->body->next = ap->body;
444 break;
445 }
446 }
447
448 ap->body->aptr = ap;
449 mutt_actx_add_attach(actx, ap);
450 update_menu(actx, menu, false);
451 menu_set_index(menu, actx->vcount - 1);
452}
void mutt_actx_add_attach(struct AttachCtx *actx, struct AttachPtr *attach)
Add an Attachment to an Attachment Context.
Definition attach.c:65
void update_menu(struct AttachCtx *actx, struct Menu *menu, bool init)
Redraw the compose window.
MenuRedrawFlags menu_set_index(struct Menu *menu, int index)
Set the current selection in the Menu.
Definition menu.c:178
short vcount
The number of virtual attachments.
Definition attach.h:72
int level
Nesting depth of attachment.
Definition attach.h:40
struct AttachPtr * aptr
Menu information, used in recvattach.c.
Definition body.h:75
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ compose_attach_swap()

static void compose_attach_swap ( struct Email * e,
struct AttachCtx * actx,
int first,
int second )
static

Swap two adjacent entries in the attachment list.

Parameters
eEmail
actxAttachment information
firstIndex of first attachment to swap
secondIndex of second attachment to swap

Definition at line 461 of file functions.c.

462{
463 struct AttachPtr **idx = actx->idx;
464
465 // check that attachments really are adjacent
466 if (idx[first]->body->next != idx[second]->body)
467 return;
468
469 // reorder Body pointers
470 if (first == 0)
471 {
472 // first attachment is the fundamental part
473 idx[first]->body->next = idx[second]->body->next;
474 idx[second]->body->next = idx[first]->body;
475 e->body = idx[second]->body;
476 }
477 else
478 {
479 // find previous attachment
480 struct Body *b_previous = NULL;
481 struct Body *b_parent = NULL;
482 if (attach_body_previous(e->body, idx[first]->body, &b_previous))
483 {
484 idx[first]->body->next = idx[second]->body->next;
485 idx[second]->body->next = idx[first]->body;
486 b_previous->next = idx[second]->body;
487 }
488 else if (attach_body_parent(e->body, NULL, idx[first]->body, &b_parent))
489 {
490 idx[first]->body->next = idx[second]->body->next;
491 idx[second]->body->next = idx[first]->body;
492 b_parent->parts = idx[second]->body;
493 }
494 }
495
496 // reorder attachment list
497 struct AttachPtr *saved = idx[second];
498 for (int i = second; i > first; i--)
499 idx[i] = idx[i - 1];
500 idx[first] = saved;
501
502 // if moved attachment is a group then move subparts too
503 if ((idx[first]->body->type == TYPE_MULTIPART) && (second < actx->idxlen - 1))
504 {
505 int i = second + 1;
506 while (idx[i]->level > idx[first]->level)
507 {
508 saved = idx[i];
509 int destidx = i - second + first;
510 for (int j = i; j > destidx; j--)
511 idx[j] = idx[j - 1];
512 idx[destidx] = saved;
513 i++;
514 if (i >= actx->idxlen)
515 break;
516 }
517 }
518}
struct Body * body
List of MIME parts.
Definition email.h:69
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ group_attachments()

static int group_attachments ( struct ComposeSharedData * shared,
char * subtype )
static

Group tagged attachments into a multipart group.

Parameters
sharedShared compose data
subtypeMIME subtype
Return values
FR_SUCCESSSuccess
FR_ERRORFailure

Definition at line 527 of file functions.c.

528{
529 struct AttachCtx *actx = shared->adata->actx;
530 int group_level = -1;
531 struct Body *bptr_parent = NULL;
532
533 // Attachments to be grouped must have the same parent
534 for (int i = 0; i < actx->idxlen; i++)
535 {
536 // check if all tagged attachments are at same level
537 if (actx->idx[i]->body->tagged)
538 {
539 if (group_level == -1)
540 {
541 group_level = actx->idx[i]->level;
542 }
543 else
544 {
545 if (group_level != actx->idx[i]->level)
546 {
547 mutt_error(_("Attachments to be grouped must have the same parent"));
548 return FR_ERROR;
549 }
550 }
551 // if not at top level check if all tagged attachments have same parent
552 if (group_level > 0)
553 {
554 if (bptr_parent)
555 {
556 struct Body *bptr_test = NULL;
557 if (!attach_body_parent(actx->idx[0]->body, NULL, actx->idx[i]->body, &bptr_test))
558 mutt_debug(LL_DEBUG5, "can't find parent\n");
559 if (bptr_test != bptr_parent)
560 {
561 mutt_error(_("Attachments to be grouped must have the same parent"));
562 return FR_ERROR;
563 }
564 }
565 else
566 {
567 if (!attach_body_parent(actx->idx[0]->body, NULL, actx->idx[i]->body, &bptr_parent))
568 mutt_debug(LL_DEBUG5, "can't find parent\n");
569 }
570 }
571 }
572 }
573
574 // Can't group all attachments unless at top level
575 if (bptr_parent)
576 {
577 if (shared->adata->menu->num_tagged == attach_body_count(bptr_parent->parts, false))
578 {
579 mutt_error(_("Can't leave group with only one attachment"));
580 return FR_ERROR;
581 }
582 }
583
584 struct Body *group = mutt_body_new();
585 group->type = TYPE_MULTIPART;
586 group->subtype = mutt_str_dup(subtype);
587 group->encoding = ENC_7BIT;
588
589 struct Body *bptr_first = NULL; // first tagged attachment
590 struct Body *bptr = NULL; // current tagged attachment
591 struct Body *group_parent = NULL; // parent of group
592 struct Body *group_previous = NULL; // previous body to group
593 struct Body *group_part = NULL; // current attachment in group
594 int group_idx = 0; // index in attachment list where group will be inserted
595 int group_last_idx = 0; // index of last part of previous found group
596 int group_parent_type = TYPE_OTHER;
597
598 for (int i = 0; i < actx->idxlen; i++)
599 {
600 bptr = actx->idx[i]->body;
601 if (bptr->tagged)
602 {
603 // set group properties based on first tagged attachment
604 if (!bptr_first)
605 {
606 group->disposition = bptr->disposition;
607 if (bptr->language && !mutt_str_equal(subtype, "multilingual"))
608 group->language = mutt_str_dup(bptr->language);
609 group_parent_type = bptr->aptr->parent_type;
610 bptr_first = bptr;
611 if (i > 0)
612 {
613 if (!attach_body_previous(shared->email->body, bptr, &group_previous))
614 {
615 mutt_debug(LL_DEBUG5, "couldn't find previous\n");
616 }
617 if (!attach_body_parent(shared->email->body, NULL, bptr, &group_parent))
618 {
619 mutt_debug(LL_DEBUG5, "couldn't find parent\n");
620 }
621 }
622 }
623
624 shared->adata->menu->num_tagged--;
625 bptr->tagged = false;
626 bptr->aptr->level++;
628
629 // append bptr to the group parts list and remove from email body list
630 struct Body *bptr_previous = NULL;
631 if (attach_body_previous(shared->email->body, bptr, &bptr_previous))
632 bptr_previous->next = bptr->next;
633 else if (attach_body_parent(shared->email->body, NULL, bptr, &bptr_parent))
634 bptr_parent->parts = bptr->next;
635 else
636 shared->email->body = bptr->next;
637
638 if (group_part)
639 {
640 // add bptr to group parts list
641 group_part->next = bptr;
642 group_part = group_part->next;
643 group_part->next = NULL;
644
645 // reorder attachments and set levels
646 int bptr_attachments = attach_body_count(bptr, true);
647 for (int j = i + 1; j < (i + bptr_attachments); j++)
648 actx->idx[j]->level++;
649 if (i > (group_last_idx + 1))
650 {
651 for (int j = 0; j < bptr_attachments; j++)
652 {
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;
657 }
658 }
659 i += bptr_attachments - 1;
660 group_last_idx += bptr_attachments;
661 }
662 else
663 {
664 group_idx = i;
665 group->parts = bptr;
666 group_part = bptr;
667 group_part->next = NULL;
668 int bptr_attachments = attach_body_count(bptr, true);
669 for (int j = i + 1; j < (i + bptr_attachments); j++)
670 actx->idx[j]->level++;
671 i += bptr_attachments - 1;
672 group_last_idx = i;
673 }
674 }
675 }
676
677 if (!bptr_first)
678 {
679 mutt_body_free(&group);
680 return FR_ERROR;
681 }
682
683 // set group->next
684 int next_aidx = group_idx + attach_body_count(group->parts, true);
685 if (group_parent)
686 {
687 // find next attachment with the same parent as the group
688 struct Body *b = NULL;
689 struct Body *b_parent = NULL;
690 while (next_aidx < actx->idxlen)
691 {
692 b = actx->idx[next_aidx]->body;
693 b_parent = NULL;
694 if (attach_body_parent(shared->email->body, NULL, b, &b_parent))
695 {
696 if (group_parent == b_parent)
697 {
698 group->next = b;
699 break;
700 }
701 }
702 next_aidx++;
703 }
704 }
705 else if (next_aidx < actx->idxlen)
706 {
707 // group is at top level
708 group->next = actx->idx[next_aidx]->body;
709 }
710
711 // set previous or parent for group
712 if (group_previous)
713 group_previous->next = group;
714 else if (group_parent)
715 group_parent->parts = group;
716
718
719 struct AttachPtr *group_ap = mutt_aptr_new();
720 group_ap->body = group;
721 group_ap->body->aptr = group_ap;
722 group_ap->level = group_level;
723 group_ap->parent_type = group_parent_type;
724
725 // insert group into attachment list
726 mutt_actx_ins_attach(actx, group_ap, group_idx);
727
728 // update email body and last attachment pointers
729 shared->email->body = actx->idx[0]->body;
730 actx->idx[actx->idxlen - 1]->body->next = NULL;
731
732 update_menu(actx, shared->adata->menu, false);
733 shared->adata->menu->current = group_idx;
735
736 exec_message_hook(NULL, shared->email, CMD_SEND2_HOOK);
737 return FR_SUCCESS;
738}
void mutt_actx_ins_attach(struct AttachCtx *actx, struct AttachPtr *attach, int aidx)
Insert an Attachment into an Attachment Context at Specified Index.
Definition attach.c:91
struct AttachPtr * mutt_aptr_new(void)
Create a new Attachment Pointer.
Definition attach.c:40
@ CMD_SEND2_HOOK
:send2-hook
Definition command.h:106
@ FR_SUCCESS
Valid function - successfully performed.
Definition dispatcher.h:40
@ FR_ERROR
Valid function - error occurred.
Definition dispatcher.h:39
struct Body * mutt_body_new(void)
Create a new Body.
Definition body.c:44
#define mutt_debug(LEVEL,...)
Definition logging2.h:91
void exec_message_hook(struct Mailbox *m, struct Email *e, enum CommandId id)
Perform a message hook.
Definition exec.c:135
@ LL_DEBUG5
Log at debug level 5.
Definition logging2.h:49
#define MENU_REDRAW_INDEX
Redraw the index.
Definition lib.h:57
void menu_queue_redraw(struct Menu *menu, MenuRedrawFlags redraw)
Queue a request for a redraw.
Definition menu.c:188
@ ENC_7BIT
7-bit text
Definition mime.h:49
@ TYPE_OTHER
Unknown Content-Type.
Definition mime.h:31
void mutt_generate_boundary(struct ParameterList *pl)
Create a unique boundary id for a MIME part.
Definition multipart.c:93
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition string.c:665
A set of attachments.
Definition attach.h:63
int parent_type
Type of parent attachment, e.g. TYPE_MULTIPART.
Definition attach.h:38
char * language
content-language (RFC8255)
Definition body.h:78
struct ParameterList parameter
Parameters of the content-type.
Definition body.h:63
unsigned int disposition
content-disposition, ContentDisposition
Definition body.h:42
char * subtype
content-type subtype
Definition body.h:61
unsigned int encoding
content-transfer-encoding, ContentEncoding
Definition body.h:41
struct Menu * menu
Menu displaying the attachments.
Definition attach_data.h:35
struct AttachCtx * actx
Set of attachments.
Definition attach_data.h:34
struct ComposeAttachData * adata
Attachments.
Definition shared_data.h:39
struct Email * email
Email being composed.
Definition shared_data.h:38
int current
Current entry.
Definition lib.h:81
int num_tagged
Number of tagged entries.
Definition lib.h:95
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ MdCompose

struct MenuDefinition* MdCompose = NULL

Compose Menu Definition.

Definition at line 74 of file functions.c.

◆ OpCompose

const struct MenuFuncOp OpCompose[]
static

Functions for the Compose Menu.

Definition at line 80 of file functions.c.

80 { /* map: compose */
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 },
85#ifdef USE_AUTOCRYPT
86 { "autocrypt-menu", OP_COMPOSE_AUTOCRYPT_MENU },
87#endif
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 },
110 { "exit", OP_EXIT },
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 },
142 { NULL, 0 },
143};

◆ ComposeDefaultBindings

const struct MenuOpSeq ComposeDefaultBindings[]
static

Key bindings for the Compose Menu.

Definition at line 148 of file functions.c.

148 { /* map: compose */
149 { OP_ATTACH_ATTACH_FILE, "a" },
150 { OP_ATTACH_ATTACH_KEY, "\033k" }, // <Alt-k>
151 { OP_ATTACH_ATTACH_MESSAGE, "A" },
152 { OP_ATTACH_DETACH, "D" },
153 { OP_ATTACH_EDIT_CONTENT_ID, "\033i" }, // <Alt-i>
154 { OP_ATTACH_EDIT_DESCRIPTION, "d" },
155 { OP_ATTACH_EDIT_ENCODING, "\005" }, // <Ctrl-E>
156 { OP_ATTACH_EDIT_LANGUAGE, "\014" }, // <Ctrl-L>
157 { OP_ATTACH_EDIT_MIME, "m" },
158 { OP_ATTACH_EDIT_TYPE, "\024" }, // <Ctrl-T>
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" },
167 { OP_EXIT, "q" },
168 { OP_PIPE, "|" },
169 { OP_ATTACH_PRINT, "l" },
170 { OP_ATTACH_RENAME_ATTACHMENT, "\017" }, // <Ctrl-O>
171 { OP_ATTACH_SAVE, "C" },
172 { OP_ATTACH_TOGGLE_DISPOSITION, "\004" }, // <Ctrl-D>
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" }, // <Enter>
178 { OP_ATTACH_VIEW, "\r" }, // <Return>
179#ifdef USE_AUTOCRYPT
180 { OP_COMPOSE_AUTOCRYPT_MENU, "o" },
181#endif
182 { OP_COMPOSE_EDIT_FILE, "\033e" }, // <Alt-e>
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" }, // <Alt-f>
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" }, // <Ctrl-F>
203 { OP_TAG, "T" },
204 { 0, NULL },
205};

◆ ComposeFunctions

const struct ComposeFunction ComposeFunctions[]
static

All the NeoMutt functions that the Compose supports.

Definition at line 2127 of file functions.c.

2127 {
2128 // clang-format off
2129 { OP_ATTACH_ATTACH_FILE, op_attach_attach_file },
2130 { OP_ATTACH_ATTACH_KEY, op_attach_attach_key },
2131 { OP_ATTACH_ATTACH_MESSAGE, op_attach_attach_message },
2132 { OP_ATTACH_ATTACH_NEWS_MESSAGE, op_attach_attach_message },
2133 { OP_ATTACH_DETACH, op_attach_detach },
2134 { OP_ATTACH_EDIT_CONTENT_ID, op_attach_edit_content_id },
2135 { OP_ATTACH_EDIT_DESCRIPTION, op_attach_edit_description },
2136 { OP_ATTACH_EDIT_ENCODING, op_attach_edit_encoding },
2137 { OP_ATTACH_EDIT_LANGUAGE, op_attach_edit_language },
2138 { OP_ATTACH_EDIT_MIME, op_attach_edit_mime },
2139 { OP_ATTACH_EDIT_TYPE, op_attach_edit_type },
2140 { OP_ATTACH_FILTER, op_attach_filter },
2141 { OP_ATTACH_GET_ATTACHMENT, op_attach_get_attachment },
2142 { OP_ATTACH_GROUP_ALTS, op_attach_group_alts },
2143 { OP_ATTACH_GROUP_LINGUAL, op_attach_group_lingual },
2144 { OP_ATTACH_GROUP_RELATED, op_attach_group_related },
2145 { OP_ATTACH_MOVE_DOWN, op_attach_move_down },
2146 { OP_ATTACH_MOVE_UP, op_attach_move_up },
2147 { OP_ATTACH_NEW_MIME, op_attach_new_mime },
2148 { OP_ATTACH_PRINT, op_attach_print },
2149 { OP_ATTACH_RENAME_ATTACHMENT, op_attach_rename_attachment },
2150 { OP_ATTACH_SAVE, op_attach_save },
2151 { OP_ATTACH_TOGGLE_DISPOSITION, op_attach_toggle_disposition },
2152 { OP_ATTACH_TOGGLE_RECODE, op_attach_toggle_recode },
2153 { OP_ATTACH_TOGGLE_UNLINK, op_attach_toggle_unlink },
2154 { OP_ATTACH_UNGROUP, op_attach_ungroup },
2155 { OP_ATTACH_UPDATE_ENCODING, op_attach_update_encoding },
2156 { OP_ATTACH_VIEW, op_display_headers },
2157 { OP_ATTACH_VIEW_MAILCAP, op_display_headers },
2158 { OP_ATTACH_VIEW_PAGER, op_display_headers },
2159 { OP_ATTACH_VIEW_TEXT, op_display_headers },
2160 { OP_COMPOSE_EDIT_FILE, op_compose_edit_file },
2161 { OP_COMPOSE_EDIT_MESSAGE, op_compose_edit_message },
2162 { OP_COMPOSE_ISPELL, op_compose_ispell },
2163 { OP_COMPOSE_POSTPONE_MESSAGE, op_compose_postpone_message },
2164 { OP_COMPOSE_RENAME_FILE, op_compose_rename_file },
2165 { OP_COMPOSE_SEND_MESSAGE, op_compose_send_message },
2166 { OP_COMPOSE_WRITE_MESSAGE, op_compose_write_message },
2167 { OP_DISPLAY_HEADERS, op_display_headers },
2168 { OP_ENVELOPE_EDIT_HEADERS, op_envelope_edit_headers },
2169 { OP_EXIT, op_exit },
2170 { OP_FORGET_PASSPHRASE, op_forget_passphrase },
2171 { OP_PIPE, op_attach_filter },
2172 { 0, NULL },
2173 // clang-format on
2174};
static int op_exit(struct AliasMenuData *mdata, const struct KeyEvent *event)
exit this menu - Implements alias_function_t -
Definition functions.c:234
static int op_attach_print(struct AttachPrivateData *priv, const struct KeyEvent *event)
print the current entry - Implements attach_function_t -
Definition functions.c:380
static int op_forget_passphrase(struct AttachPrivateData *priv, const struct KeyEvent *event)
wipe passphrases from memory - Implements attach_function_t -
Definition functions.c:569
static int op_attach_save(struct AttachPrivateData *priv, const struct KeyEvent *event)
save message/attachment to a mailbox/file - Implements attach_function_t -
Definition functions.c:391
static int op_attach_edit_type(struct AttachPrivateData *priv, const struct KeyEvent *event)
edit attachment content type - Implements attach_function_t -
Definition functions.c:359
static int op_attach_group_related(struct ComposeSharedData *shared, const struct KeyEvent *event)
Group tagged attachments as 'multipart/related' - Implements compose_function_t -.
Definition functions.c:1344
static int op_attach_attach_file(struct ComposeSharedData *shared, const struct KeyEvent *event)
Attach files to this message - Implements compose_function_t -.
Definition functions.c:745
static int op_display_headers(struct ComposeSharedData *shared, const struct KeyEvent *event)
Display message and toggle header weeding - Implements compose_function_t -.
Definition functions.c:2033
static int op_attach_edit_language(struct ComposeSharedData *shared, const struct KeyEvent *event)
Edit the 'Content-Language' of the attachment - Implements compose_function_t -.
Definition functions.c:1154
static int op_attach_detach(struct ComposeSharedData *shared, const struct KeyEvent *event)
Delete the current entry - Implements compose_function_t -.
Definition functions.c:988
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 -.
Definition functions.c:1024
static int op_compose_ispell(struct ComposeSharedData *shared, const struct KeyEvent *event)
Run ispell on the message - Implements compose_function_t -.
Definition functions.c:1872
static int op_attach_filter(struct ComposeSharedData *shared, const struct KeyEvent *event)
Filter attachment through a shell command - Implements compose_function_t -.
Definition functions.c:1233
static int op_attach_edit_encoding(struct ComposeSharedData *shared, const struct KeyEvent *event)
Edit attachment transfer-encoding - Implements compose_function_t -.
Definition functions.c:1110
static int op_attach_ungroup(struct ComposeSharedData *shared, const struct KeyEvent *event)
Ungroup a 'multipart' attachment - Implements compose_function_t -.
Definition functions.c:1679
static int op_attach_group_alts(struct ComposeSharedData *shared, const struct KeyEvent *event)
Group tagged attachments as 'multipart/alternative' - Implements compose_function_t -.
Definition functions.c:1299
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 -.
Definition functions.c:1427
static int op_compose_rename_file(struct ComposeSharedData *shared, const struct KeyEvent *event)
Rename/move an attached file - Implements compose_function_t -.
Definition functions.c:1913
static int op_envelope_edit_headers(struct ComposeSharedData *shared, const struct KeyEvent *event)
Edit the message with headers - Implements compose_function_t -.
Definition functions.c:1776
static int op_compose_postpone_message(struct ComposeSharedData *shared, const struct KeyEvent *event)
Save this message to send later - Implements compose_function_t -.
Definition functions.c:1897
static int op_attach_toggle_recode(struct ComposeSharedData *shared, const struct KeyEvent *event)
Toggle recoding of this attachment - Implements compose_function_t -.
Definition functions.c:1637
static int op_compose_write_message(struct ComposeSharedData *shared, const struct KeyEvent *event)
Write the message to a folder - Implements compose_function_t -.
Definition functions.c:1990
static int op_attach_group_lingual(struct ComposeSharedData *shared, const struct KeyEvent *event)
Group tagged attachments as 'multipart/multilingual' - Implements compose_function_t -.
Definition functions.c:1313
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 -.
Definition functions.c:1371
static int op_attach_toggle_disposition(struct ComposeSharedData *shared, const struct KeyEvent *event)
Toggle disposition between inline/attachment - Implements compose_function_t -.
Definition functions.c:1618
static int op_compose_send_message(struct ComposeSharedData *shared, const struct KeyEvent *event)
Send the message - Implements compose_function_t -.
Definition functions.c:1962
static int op_attach_rename_attachment(struct ComposeSharedData *shared, const struct KeyEvent *event)
Send attachment with a different name - Implements compose_function_t -.
Definition functions.c:1566
static int op_attach_attach_message(struct ComposeSharedData *shared, const struct KeyEvent *event)
Attach messages to this message - Implements compose_function_t -.
Definition functions.c:838
static int op_attach_edit_description(struct ComposeSharedData *shared, const struct KeyEvent *event)
Edit attachment description - Implements compose_function_t -.
Definition functions.c:1078
static int op_attach_update_encoding(struct ComposeSharedData *shared, const struct KeyEvent *event)
Update an attachment's encoding info - Implements compose_function_t -.
Definition functions.c:1741
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 -.
Definition functions.c:1662
static int op_attach_new_mime(struct ComposeSharedData *shared, const struct KeyEvent *event)
Compose new attachment using mailcap entry - Implements compose_function_t -.
Definition functions.c:1462
static int op_attach_edit_mime(struct ComposeSharedData *shared, const struct KeyEvent *event)
Edit attachment using mailcap entry - Implements compose_function_t -.
Definition functions.c:1191
static int op_compose_edit_message(struct ComposeSharedData *shared, const struct KeyEvent *event)
Edit the message - Implements compose_function_t -.
Definition functions.c:1849
static int op_attach_get_attachment(struct ComposeSharedData *shared, const struct KeyEvent *event)
Get a temporary copy of an attachment - Implements compose_function_t -.
Definition functions.c:1262
static int op_compose_edit_file(struct ComposeSharedData *shared, const struct KeyEvent *event)
Edit the file to be attached - Implements compose_function_t -.
Definition functions.c:1825
static int op_attach_attach_key(struct ComposeSharedData *shared, const struct KeyEvent *event)
Attach a PGP public key - Implements compose_function_t -.
Definition functions.c:810