NeoMutt  2020-06-26-30-g76c339
Teaching an old dog new tricks
DOXYGEN
recvattach.h File Reference

Routines for managing attachments. More...

#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdio.h>
#include "format_flags.h"
+ Include dependency graph for recvattach.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void mutt_attach_init (struct AttachCtx *actx)
 Create a new Attachment context. More...
 
void mutt_update_tree (struct AttachCtx *actx)
 Refresh the list of attachments. More...
 
const char * attach_format_str (char *buf, size_t buflen, size_t col, int cols, char op, const char *src, const char *prec, const char *if_str, const char *else_str, intptr_t data, MuttFormatFlags flags)
 Format a string for the attachment menu - Implements format_t. More...
 
void mutt_view_attachments (struct Email *e)
 Show the attachments in a Menu. More...
 
void mutt_generate_recvattach_list (struct AttachCtx *actx, struct Email *e, struct Body *parts, FILE *fp, int parent_type, int level, bool decrypted)
 Create a list of attachments. More...
 

Variables

char * C_AttachSaveDir
 Config: Default directory where attachments are saved. More...
 
char * C_AttachSaveWithoutPrompting
 Config: If true, then don't prompt to save. More...
 
char * C_AttachSep
 Config: Separator to add between saved/printed/piped attachments. More...
 
bool C_AttachSplit
 Config: Save/print/pipe tagged messages individually. More...
 
bool C_DigestCollapse
 Config: Hide the subparts of a multipart/digest. More...
 
char * C_MessageFormat
 Config: printf-like format string for listing attached messages. More...
 

Detailed Description

Routines for managing attachments.

Authors
  • Michael R. Elkins
  • Thomas Roessler

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 recvattach.h.

Function Documentation

◆ mutt_attach_init()

void mutt_attach_init ( struct AttachCtx actx)

Create a new Attachment context.

Parameters
actxAttachment context

Definition at line 1334 of file recvattach.c.

1335 {
1336  /* Collapse the attachments if '$digest_collapse' is set AND if...
1337  * the outer container is of type 'multipart/digest' */
1338  bool digest = mutt_istr_equal(actx->email->content->subtype, "digest");
1339 
1340  for (int i = 0; i < actx->idxlen; i++)
1341  {
1342  actx->idx[i]->content->tagged = false;
1343 
1344  /* OR an inner container is of type 'multipart/digest' */
1345  actx->idx[i]->content->collapsed =
1346  (C_DigestCollapse && (digest ||
1347  ((actx->idx[i]->content->type == TYPE_MULTIPART) &&
1348  mutt_istr_equal(actx->idx[i]->content->subtype, "digest"))));
1349  }
1350 }
struct Email * email
Used by recvattach for updating.
Definition: attach.h:51
struct Body * content
List of MIME parts.
Definition: email.h:90
bool C_DigestCollapse
Config: Hide the subparts of a multipart/digest.
Definition: recvattach.c:74
short idxlen
Number of attachmentes.
Definition: attach.h:55
bool tagged
This attachment is tagged.
Definition: body.h:70
bool collapsed
Used by recvattach.
Definition: body.h:82
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition: string.c:891
char * subtype
content-type subtype
Definition: body.h:37
unsigned int type
content-type primary type, ContentType
Definition: body.h:65
Type: &#39;multipart/*&#39;.
Definition: mime.h:37
struct Body * content
Attachment.
Definition: attach.h:36
struct AttachPtr ** idx
Array of attachments.
Definition: attach.h:54
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_update_tree()

void mutt_update_tree ( struct AttachCtx actx)

Refresh the list of attachments.

Parameters
actxAttachment context

Definition at line 142 of file recvattach.c.

143 {
144  char buf[256];
145  char *s = NULL;
146 
147  mutt_update_v2r(actx);
148 
149  for (int vindex = 0; vindex < actx->vcount; vindex++)
150  {
151  const int rindex = actx->v2r[vindex];
152  actx->idx[rindex]->num = vindex;
153  if ((2 * (actx->idx[rindex]->level + 2)) < sizeof(buf))
154  {
155  if (actx->idx[rindex]->level)
156  {
157  s = buf + 2 * (actx->idx[rindex]->level - 1);
158  *s++ = (actx->idx[rindex]->content->next) ? MUTT_TREE_LTEE : MUTT_TREE_LLCORNER;
159  *s++ = MUTT_TREE_HLINE;
160  *s++ = MUTT_TREE_RARROW;
161  }
162  else
163  s = buf;
164  *s = '\0';
165  }
166 
167  if (actx->idx[rindex]->tree)
168  {
169  if (!mutt_str_equal(actx->idx[rindex]->tree, buf))
170  mutt_str_replace(&actx->idx[rindex]->tree, buf);
171  }
172  else
173  actx->idx[rindex]->tree = mutt_str_dup(buf);
174 
175  if (((2 * (actx->idx[rindex]->level + 2)) < sizeof(buf)) &&
176  actx->idx[rindex]->level)
177  {
178  s = buf + 2 * (actx->idx[rindex]->level - 1);
179  *s++ = (actx->idx[rindex]->content->next) ? '\005' : '\006';
180  *s++ = '\006';
181  }
182  }
183 }
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:879
Lower left corner.
Definition: mutt_menu.h:59
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:375
struct Body * next
next attachment in the list
Definition: body.h:53
Right arrow.
Definition: mutt_menu.h:65
char * tree
Tree characters to display.
Definition: attach.h:39
static void mutt_update_v2r(struct AttachCtx *actx)
Update the virtual list of attachments.
Definition: recvattach.c:113
int num
Attachment index number.
Definition: attach.h:41
void mutt_str_replace(char **p, const char *s)
Replace one string with another.
Definition: string.c:450
short * v2r
Mapping from virtual to real attachment.
Definition: attach.h:58
struct Body * content
Attachment.
Definition: attach.h:36
int level
Nesting depth of attachment.
Definition: attach.h:40
struct AttachPtr ** idx
Array of attachments.
Definition: attach.h:54
Left T-piece.
Definition: mutt_menu.h:61
short vcount
The number of virtual attachments.
Definition: attach.h:59
Horizontal line.
Definition: mutt_menu.h:62
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ attach_format_str()

const char* attach_format_str ( char *  buf,
size_t  buflen,
size_t  col,
int  cols,
char  op,
const char *  src,
const char *  prec,
const char *  if_str,
const char *  else_str,
intptr_t  data,
MuttFormatFlags  flags 
)

Format a string for the attachment menu - Implements format_t.

Expando Description
%C Character set
%c Character set: convert?
%D Deleted flag
%d Description
%e MIME content-transfer-encoding
%f Filename
%F Filename for content-disposition header
%I Content-disposition, either I (inline) or A (attachment)
%m Major MIME type
%M MIME subtype
%n Attachment number
%Q 'Q', if MIME part qualifies for attachment counting
%s Size
%t Tagged flag
%T Tree chars
%u Unlink
%X Number of qualifying MIME parts in this part and its children

Definition at line 208 of file recvattach.c.

211 {
212  char fmt[128];
213  char charset[128];
214  struct AttachPtr *aptr = (struct AttachPtr *) data;
215  bool optional = (flags & MUTT_FORMAT_OPTIONAL);
216 
217  switch (op)
218  {
219  case 'C':
220  if (!optional)
221  {
222  if (mutt_is_text_part(aptr->content) &&
223  mutt_body_get_charset(aptr->content, charset, sizeof(charset)))
224  {
225  mutt_format_s(buf, buflen, prec, charset);
226  }
227  else
228  mutt_format_s(buf, buflen, prec, "");
229  }
230  else if (!mutt_is_text_part(aptr->content) ||
231  !mutt_body_get_charset(aptr->content, charset, sizeof(charset)))
232  {
233  optional = false;
234  }
235  break;
236  case 'c':
237  /* XXX */
238  if (!optional)
239  {
240  snprintf(fmt, sizeof(fmt), "%%%sc", prec);
241  snprintf(buf, buflen, fmt,
242  ((aptr->content->type != TYPE_TEXT) || aptr->content->noconv) ? 'n' : 'c');
243  }
244  else if ((aptr->content->type != TYPE_TEXT) || aptr->content->noconv)
245  optional = false;
246  break;
247  case 'd':
248  if (!optional)
249  {
250  if (aptr->content->description)
251  {
252  mutt_format_s(buf, buflen, prec, aptr->content->description);
253  break;
254  }
255  if (mutt_is_message_type(aptr->content->type, aptr->content->subtype) &&
256  C_MessageFormat && aptr->content->email)
257  {
258  char s[128];
259  mutt_make_string_flags(s, sizeof(s), cols, C_MessageFormat, NULL,
260  NULL, aptr->content->email,
262  if (*s)
263  {
264  mutt_format_s(buf, buflen, prec, s);
265  break;
266  }
267  }
268  if (!aptr->content->d_filename && !aptr->content->filename)
269  {
270  mutt_format_s(buf, buflen, prec, "<no description>");
271  break;
272  }
273  }
274  else if (aptr->content->description ||
275  (mutt_is_message_type(aptr->content->type, aptr->content->subtype) &&
276  C_MessageFormat && aptr->content->email))
277  {
278  break;
279  }
280  /* fallthrough */
281  case 'F':
282  if (!optional)
283  {
284  if (aptr->content->d_filename)
285  {
286  mutt_format_s(buf, buflen, prec, aptr->content->d_filename);
287  break;
288  }
289  }
290  else if (!aptr->content->d_filename && !aptr->content->filename)
291  {
292  optional = false;
293  break;
294  }
295  /* fallthrough */
296  case 'f':
297  if (!optional)
298  {
299  if (aptr->content->filename && (*aptr->content->filename == '/'))
300  {
301  struct Buffer *path = mutt_buffer_pool_get();
302 
303  mutt_buffer_strcpy(path, aptr->content->filename);
305  mutt_format_s(buf, buflen, prec, mutt_b2s(path));
307  }
308  else
309  mutt_format_s(buf, buflen, prec, NONULL(aptr->content->filename));
310  }
311  else if (!aptr->content->filename)
312  optional = false;
313  break;
314  case 'D':
315  if (!optional)
316  snprintf(buf, buflen, "%c", aptr->content->deleted ? 'D' : ' ');
317  else if (!aptr->content->deleted)
318  optional = false;
319  break;
320  case 'e':
321  if (!optional)
322  mutt_format_s(buf, buflen, prec, ENCODING(aptr->content->encoding));
323  break;
324  case 'I':
325  if (optional)
326  break;
327 
328  const char dispchar[] = { 'I', 'A', 'F', '-' };
329  char ch;
330 
331  if (aptr->content->disposition < sizeof(dispchar))
332  ch = dispchar[aptr->content->disposition];
333  else
334  {
335  mutt_debug(LL_DEBUG1, "ERROR: invalid content-disposition %d\n",
336  aptr->content->disposition);
337  ch = '!';
338  }
339  snprintf(buf, buflen, "%c", ch);
340  break;
341  case 'm':
342  if (!optional)
343  mutt_format_s(buf, buflen, prec, TYPE(aptr->content));
344  break;
345  case 'M':
346  if (!optional)
347  mutt_format_s(buf, buflen, prec, aptr->content->subtype);
348  else if (!aptr->content->subtype)
349  optional = false;
350  break;
351  case 'n':
352  if (optional)
353  break;
354 
355  snprintf(fmt, sizeof(fmt), "%%%sd", prec);
356  snprintf(buf, buflen, fmt, aptr->num + 1);
357  break;
358  case 'Q':
359  if (optional)
360  optional = aptr->content->attach_qualifies;
361  else
362  {
363  snprintf(fmt, sizeof(fmt), "%%%sc", prec);
364  mutt_format_s(buf, buflen, fmt, "Q");
365  }
366  break;
367  case 's':
368  {
369  size_t l;
370  if (flags & MUTT_FORMAT_STAT_FILE)
371  {
372  struct stat st;
373  stat(aptr->content->filename, &st);
374  l = st.st_size;
375  }
376  else
377  l = aptr->content->length;
378 
379  if (!optional)
380  {
381  char tmp[128];
382  mutt_str_pretty_size(tmp, sizeof(tmp), l);
383  mutt_format_s(buf, buflen, prec, tmp);
384  }
385  else if (l == 0)
386  optional = false;
387 
388  break;
389  }
390  case 't':
391  if (!optional)
392  snprintf(buf, buflen, "%c", aptr->content->tagged ? '*' : ' ');
393  else if (!aptr->content->tagged)
394  optional = false;
395  break;
396  case 'T':
397  if (!optional)
398  mutt_format_s_tree(buf, buflen, prec, NONULL(aptr->tree));
399  else if (!aptr->tree)
400  optional = false;
401  break;
402  case 'u':
403  if (!optional)
404  snprintf(buf, buflen, "%c", aptr->content->unlink ? '-' : ' ');
405  else if (!aptr->content->unlink)
406  optional = false;
407  break;
408  case 'X':
409  if (optional)
410  optional = ((aptr->content->attach_count + aptr->content->attach_qualifies) != 0);
411  else
412  {
413  snprintf(fmt, sizeof(fmt), "%%%sd", prec);
414  snprintf(buf, buflen, fmt, aptr->content->attach_count + aptr->content->attach_qualifies);
415  }
416  break;
417  default:
418  *buf = '\0';
419  }
420 
421  if (optional)
422  {
423  mutt_expando_format(buf, buflen, col, cols, if_str, attach_format_str, data,
425  }
426  else if (flags & MUTT_FORMAT_OPTIONAL)
427  {
428  mutt_expando_format(buf, buflen, col, cols, else_str, attach_format_str,
429  data, MUTT_FORMAT_NO_FLAGS);
430  }
431  return src;
432 }
char * filename
when sending a message, this is the file to which this structure refers
Definition: body.h:46
#define NONULL(x)
Definition: string2.h:37
An email to which things will be attached.
Definition: attach.h:34
char * C_MessageFormat
Config: printf-like format string for listing attached messages.
Definition: recvattach.c:75
bool mutt_is_message_type(int type, const char *subtype)
Determine if a mime type matches a message or not.
Definition: parse.c:1360
struct Buffer * mutt_buffer_pool_get(void)
Get a Buffer from the pool.
Definition: pool.c:101
#define MUTT_FORMAT_FORCESUBJ
Print the subject even if unchanged.
Definition: format_flags.h:31
static int const char * fmt
Definition: acutest.h:488
void mutt_buffer_pool_release(struct Buffer **pbuf)
Free a Buffer from the pool.
Definition: pool.c:112
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: format_flags.h:35
bool noconv
Don&#39;t do character set conversion.
Definition: body.h:73
String manipulation buffer.
Definition: buffer.h:33
#define MUTT_FORMAT_STAT_FILE
Used by attach_format_str.
Definition: format_flags.h:34
void mutt_buffer_pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using &#39;~&#39; or &#39;=&#39;.
Definition: muttlib.c:688
#define MUTT_FORMAT_NO_FLAGS
No flags are set.
Definition: format_flags.h:30
unsigned int disposition
content-disposition, ContentDisposition
Definition: body.h:67
char * tree
Tree characters to display.
Definition: attach.h:39
bool attach_qualifies
This attachment should be counted.
Definition: body.h:83
void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const char *src, format_t *callback, intptr_t data, MuttFormatFlags flags)
Expand expandos (x) in a string.
Definition: muttlib.c:862
void mutt_make_string_flags(char *buf, size_t buflen, int cols, const char *s, struct Context *ctx, struct Mailbox *m, struct Email *e, MuttFormatFlags flags)
Create formatted strings using mailbox expandos.
Definition: hdrline.c:1407
#define ENCODING(x)
Definition: mime.h:85
signed short attach_count
Number of attachments.
Definition: body.h:59
bool tagged
This attachment is tagged.
Definition: body.h:70
unsigned int encoding
content-transfer-encoding, ContentEncoding
Definition: body.h:66
char * subtype
content-type subtype
Definition: body.h:37
#define mutt_b2s(buf)
Definition: buffer.h:41
LOFF_T length
length (in bytes) of attachment
Definition: body.h:45
int num
Attachment index number.
Definition: attach.h:41
Type: &#39;text/*&#39;.
Definition: mime.h:38
void mutt_str_pretty_size(char *buf, size_t buflen, size_t num)
Display an abbreviated size, like 3.4K.
Definition: muttlib.c:1749
char * mutt_body_get_charset(struct Body *b, char *buf, size_t buflen)
Get a body&#39;s character set.
Definition: sendlib.c:1462
char * description
content-description
Definition: body.h:40
bool mutt_is_text_part(struct Body *b)
Is this part of an email in plain text?
Definition: muttlib.c:437
size_t mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition: buffer.c:312
unsigned int type
content-type primary type, ContentType
Definition: body.h:65
bool deleted
Attachment marked for deletion.
Definition: body.h:71
#define TYPE(body)
Definition: mime.h:83
void mutt_format_s(char *buf, size_t buflen, const char *prec, const char *s)
Format a simple string.
Definition: curs_lib.c:1223
Log at debug level 1.
Definition: logging.h:40
struct Body * content
Attachment.
Definition: attach.h:36
bool unlink
If true, filename should be unlink()ed before free()ing this structure.
Definition: body.h:69
const char * attach_format_str(char *buf, size_t buflen, size_t col, int cols, char op, const char *src, const char *prec, const char *if_str, const char *else_str, intptr_t data, MuttFormatFlags flags)
Format a string for the attachment menu - Implements format_t.
Definition: recvattach.c:208
#define MUTT_FORMAT_OPTIONAL
Allow optional field processing.
Definition: format_flags.h:33
char * d_filename
filename to be used for the content-disposition header.
Definition: body.h:47
#define mutt_debug(LEVEL,...)
Definition: logging.h:81
struct Email * email
header information for message/rfc822
Definition: body.h:55
void mutt_format_s_tree(char *buf, size_t buflen, const char *prec, const char *s)
Format a simple string with tree characters.
Definition: curs_lib.c:1235
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_view_attachments()

void mutt_view_attachments ( struct Email e)

Show the attachments in a Menu.

Parameters
eEmail

Definition at line 1414 of file recvattach.c.

1415 {
1416  char helpstr[1024];
1417  int op = OP_NULL;
1418 
1419  struct Mailbox *m = Context ? Context->mailbox : NULL;
1420 
1421  /* make sure we have parsed this message */
1423 
1425 
1426  struct Message *msg = mx_msg_open(m, e->msgno);
1427  if (!msg)
1428  return;
1429 
1430  struct MuttWindow *dlg =
1433  dlg->notify = notify_new();
1434 
1435  struct MuttWindow *index =
1438  index->notify = notify_new();
1439  notify_set_parent(index->notify, dlg->notify);
1440 
1441  struct MuttWindow *ibar =
1444  ibar->notify = notify_new();
1445  notify_set_parent(ibar->notify, dlg->notify);
1446 
1447  if (C_StatusOnTop)
1448  {
1449  mutt_window_add_child(dlg, ibar);
1450  mutt_window_add_child(dlg, index);
1451  }
1452  else
1453  {
1454  mutt_window_add_child(dlg, index);
1455  mutt_window_add_child(dlg, ibar);
1456  }
1457 
1458  dialog_push(dlg);
1459 
1460  struct Menu *menu = mutt_menu_new(MENU_ATTACH);
1461 
1462  menu->pagelen = index->state.rows;
1463  menu->win_index = index;
1464  menu->win_ibar = ibar;
1465 
1466  menu->title = _("Attachments");
1467  menu->make_entry = attach_make_entry;
1468  menu->tag = attach_tag;
1469  menu->help = mutt_compile_help(helpstr, sizeof(helpstr), MENU_ATTACH, AttachHelp);
1470  mutt_menu_push_current(menu);
1471 
1472  struct AttachCtx *actx = mutt_actx_new();
1473  actx->email = e;
1474  actx->fp_root = msg->fp;
1475  mutt_update_recvattach_menu(actx, menu, true);
1476 
1477  while (true)
1478  {
1479  if (op == OP_NULL)
1480  op = mutt_menu_loop(menu);
1481  if (!Context)
1482  return;
1483  switch (op)
1484  {
1485  case OP_ATTACH_VIEW_MAILCAP:
1487  MUTT_VA_MAILCAP, e, actx, menu->win_index);
1488  menu->redraw = REDRAW_FULL;
1489  break;
1490 
1491  case OP_ATTACH_VIEW_TEXT:
1493  MUTT_VA_AS_TEXT, e, actx, menu->win_index);
1494  menu->redraw = REDRAW_FULL;
1495  break;
1496 
1497  case OP_DISPLAY_HEADERS:
1498  case OP_VIEW_ATTACH:
1499  op = mutt_attach_display_loop(menu, op, e, actx, true);
1500  menu->redraw = REDRAW_FULL;
1501  continue;
1502 
1503  case OP_ATTACH_COLLAPSE:
1504  if (!CUR_ATTACH->content->parts)
1505  {
1506  mutt_error(_("There are no subparts to show"));
1507  break;
1508  }
1509  attach_collapse(actx, menu);
1510  mutt_update_recvattach_menu(actx, menu, false);
1511  break;
1512 
1513  case OP_FORGET_PASSPHRASE:
1515  break;
1516 
1517  case OP_EXTRACT_KEYS:
1519  {
1520  recvattach_extract_pgp_keys(actx, menu);
1521  menu->redraw = REDRAW_FULL;
1522  }
1523  break;
1524 
1525  case OP_CHECK_TRADITIONAL:
1526  if (((WithCrypto & APPLICATION_PGP) != 0) &&
1528  {
1529  e->security = crypt_query(NULL);
1530  menu->redraw = REDRAW_FULL;
1531  }
1532  break;
1533 
1534  case OP_PRINT:
1536  CUR_ATTACH->content);
1537  break;
1538 
1539  case OP_PIPE:
1541  CUR_ATTACH->content, false);
1542  break;
1543 
1544  case OP_SAVE:
1546  CUR_ATTACH->content, e, menu);
1547 
1548  if (!menu->tagprefix && C_Resolve && (menu->current < menu->max - 1))
1549  menu->current++;
1550 
1552  break;
1553 
1554  case OP_DELETE:
1556 
1557 #ifdef USE_POP
1558  if (m->type == MUTT_POP)
1559  {
1560  mutt_flushinp();
1561  mutt_error(_("Can't delete attachment from POP server"));
1562  break;
1563  }
1564 #endif
1565 
1566 #ifdef USE_NNTP
1567  if (m->type == MUTT_NNTP)
1568  {
1569  mutt_flushinp();
1570  mutt_error(_("Can't delete attachment from news server"));
1571  break;
1572  }
1573 #endif
1574 
1575  if ((WithCrypto != 0) && (e->security & SEC_ENCRYPT))
1576  {
1577  mutt_message(_("Deletion of attachments from encrypted messages is "
1578  "unsupported"));
1579  break;
1580  }
1581  if ((WithCrypto != 0) && (e->security & (SEC_SIGN | SEC_PARTSIGN)))
1582  {
1583  mutt_message(_("Deletion of attachments from signed messages may "
1584  "invalidate the signature"));
1585  }
1586  if (!menu->tagprefix)
1587  {
1588  if (CUR_ATTACH->parent_type == TYPE_MULTIPART)
1589  {
1590  CUR_ATTACH->content->deleted = true;
1591  if (C_Resolve && (menu->current < menu->max - 1))
1592  {
1593  menu->current++;
1594  menu->redraw = REDRAW_MOTION_RESYNC;
1595  }
1596  else
1597  menu->redraw = REDRAW_CURRENT;
1598  }
1599  else
1600  {
1601  mutt_message(
1602  _("Only deletion of multipart attachments is supported"));
1603  }
1604  }
1605  else
1606  {
1607  for (int i = 0; i < menu->max; i++)
1608  {
1609  if (actx->idx[i]->content->tagged)
1610  {
1611  if (actx->idx[i]->parent_type == TYPE_MULTIPART)
1612  {
1613  actx->idx[i]->content->deleted = true;
1614  menu->redraw = REDRAW_INDEX;
1615  }
1616  else
1617  {
1618  mutt_message(
1619  _("Only deletion of multipart attachments is supported"));
1620  }
1621  }
1622  }
1623  }
1624  break;
1625 
1626  case OP_UNDELETE:
1628  if (!menu->tagprefix)
1629  {
1630  CUR_ATTACH->content->deleted = false;
1631  if (C_Resolve && (menu->current < menu->max - 1))
1632  {
1633  menu->current++;
1634  menu->redraw = REDRAW_MOTION_RESYNC;
1635  }
1636  else
1637  menu->redraw = REDRAW_CURRENT;
1638  }
1639  else
1640  {
1641  for (int i = 0; i < menu->max; i++)
1642  {
1643  if (actx->idx[i]->content->tagged)
1644  {
1645  actx->idx[i]->content->deleted = false;
1646  menu->redraw = REDRAW_INDEX;
1647  }
1648  }
1649  }
1650  break;
1651 
1652  case OP_RESEND:
1653  CHECK_ATTACH;
1654  mutt_attach_resend(CUR_ATTACH->fp, actx,
1655  menu->tagprefix ? NULL : CUR_ATTACH->content);
1656  menu->redraw = REDRAW_FULL;
1657  break;
1658 
1659  case OP_BOUNCE_MESSAGE:
1660  CHECK_ATTACH;
1661  mutt_attach_bounce(m, CUR_ATTACH->fp, actx,
1662  menu->tagprefix ? NULL : CUR_ATTACH->content);
1663  menu->redraw = REDRAW_FULL;
1664  break;
1665 
1666  case OP_FORWARD_MESSAGE:
1667  CHECK_ATTACH;
1668  mutt_attach_forward(CUR_ATTACH->fp, e, actx,
1669  menu->tagprefix ? NULL : CUR_ATTACH->content, SEND_NO_FLAGS);
1670  menu->redraw = REDRAW_FULL;
1671  break;
1672 
1673 #ifdef USE_NNTP
1674  case OP_FORWARD_TO_GROUP:
1675  CHECK_ATTACH;
1676  mutt_attach_forward(CUR_ATTACH->fp, e, actx,
1677  menu->tagprefix ? NULL : CUR_ATTACH->content, SEND_NEWS);
1678  menu->redraw = REDRAW_FULL;
1679  break;
1680 
1681  case OP_FOLLOWUP:
1682  CHECK_ATTACH;
1683 
1684  if (!CUR_ATTACH->content->email->env->followup_to ||
1685  !mutt_istr_equal(CUR_ATTACH->content->email->env->followup_to,
1686  "poster") ||
1688  _("Reply by mail as poster prefers?")) != MUTT_YES))
1689  {
1690  mutt_attach_reply(CUR_ATTACH->fp, e, actx,
1691  menu->tagprefix ? NULL : CUR_ATTACH->content,
1692  SEND_NEWS | SEND_REPLY);
1693  menu->redraw = REDRAW_FULL;
1694  break;
1695  }
1696 #endif
1697  /* fallthrough */
1698  case OP_REPLY:
1699  case OP_GROUP_REPLY:
1700  case OP_GROUP_CHAT_REPLY:
1701  case OP_LIST_REPLY:
1702  {
1703  CHECK_ATTACH;
1704 
1705  SendFlags flags = SEND_REPLY;
1706  if (op == OP_GROUP_REPLY)
1707  flags |= SEND_GROUP_REPLY;
1708  else if (op == OP_GROUP_CHAT_REPLY)
1709  flags |= SEND_GROUP_CHAT_REPLY;
1710  else if (op == OP_LIST_REPLY)
1711  flags |= SEND_LIST_REPLY;
1712 
1713  mutt_attach_reply(CUR_ATTACH->fp, e, actx,
1714  menu->tagprefix ? NULL : CUR_ATTACH->content, flags);
1715  menu->redraw = REDRAW_FULL;
1716  break;
1717  }
1718 
1719  case OP_COMPOSE_TO_SENDER:
1720  CHECK_ATTACH;
1721  mutt_attach_mail_sender(CUR_ATTACH->fp, e, actx,
1722  menu->tagprefix ? NULL : CUR_ATTACH->content);
1723  menu->redraw = REDRAW_FULL;
1724  break;
1725 
1726  case OP_EDIT_TYPE:
1727  recvattach_edit_content_type(actx, menu, e);
1728  menu->redraw |= REDRAW_INDEX;
1729  break;
1730 
1731  case OP_EXIT:
1732  mx_msg_close(m, &msg);
1733 
1734  e->attach_del = false;
1735  for (int i = 0; i < actx->idxlen; i++)
1736  {
1737  if (actx->idx[i]->content && actx->idx[i]->content->deleted)
1738  {
1739  e->attach_del = true;
1740  break;
1741  }
1742  }
1743  if (e->attach_del)
1744  e->changed = true;
1745 
1746  mutt_actx_free(&actx);
1747 
1748  mutt_menu_pop_current(menu);
1749  mutt_menu_free(&menu);
1750  dialog_pop();
1751  mutt_window_free(&dlg);
1752  return;
1753  }
1754 
1755  op = OP_NULL;
1756  }
1757 
1758  /* not reached */
1759 }
The "current" mailbox.
Definition: context.h:37
WHERE bool C_StatusOnTop
Config: Display the status bar at the top.
Definition: globals.h:247
#define REDRAW_FULL
Redraw everything.
Definition: mutt_menu.h:45
void mutt_actx_free(struct AttachCtx **ptr)
Free an Attachment Context.
Definition: attach.c:140
enum MailboxType type
Mailbox type.
Definition: mailbox.h:105
#define WithCrypto
Definition: lib.h:163
static const struct Mapping AttachHelp[]
Definition: recvattach.c:91
GUI selectable list of items.
Definition: mutt_menu.h:80
static void attach_make_entry(char *buf, size_t buflen, struct Menu *menu, int line)
Format a menu item for the attachment list - Implements Menu::make_entry()
Definition: recvattach.c:437
&#39;NNTP&#39; (Usenet) Mailbox type
Definition: mailbox.h:52
enum QuadOption query_quadoption(enum QuadOption opt, const char *prompt)
Ask the user a quad-question.
Definition: init.c:1112
#define mutt_message(...)
Definition: logging.h:83
Attach Dialog, mutt_view_attachments()
Definition: mutt_window.h:75
Window uses all available vertical space.
Definition: mutt_window.h:35
struct Email * email
Used by recvattach for updating.
Definition: attach.h:51
User answered &#39;Yes&#39;, or assume &#39;Yes&#39;.
Definition: quad.h:40
void dialog_pop(void)
Hide a Window from the user.
Definition: mutt_window.c:722
#define SEC_ENCRYPT
Email is encrypted.
Definition: lib.h:125
WHERE unsigned char C_FollowupToPoster
Config: (nntp) Reply to the poster if &#39;poster&#39; is in the &#39;Followup-To&#39; header.
Definition: globals.h:186
void mutt_flushinp(void)
Empty all the keyboard buffers.
Definition: curs_lib.c:898
bool attach_del
Has an attachment marked for deletion.
Definition: email.h:49
void dialog_push(struct MuttWindow *dlg)
Display a Window to the user.
Definition: mutt_window.c:697
void crypt_forget_passphrase(void)
Forget a passphrase and display a message.
Definition: crypt.c:104
FILE * fp_root
Used by recvattach for updating.
Definition: attach.h:52
void mutt_parse_mime_message(struct Mailbox *m, struct Email *e)
Parse a MIME email.
Definition: mutt_parse.c:48
#define _(a)
Definition: message.h:28
bool changed
Email has been edited.
Definition: email.h:48
short idxlen
Number of attachmentes.
Definition: attach.h:55
Force viewing as text.
Definition: mutt_attach.h:44
A division of the screen.
Definition: mutt_window.h:108
#define MUTT_MESSAGE_HOOK
message-hook: run before displaying a message
Definition: hook.h:52
uint16_t SendFlags
Flags for mutt_send_message(), e.g. SEND_REPLY.
Definition: send.h:86
#define CUR_ATTACH
Definition: recvattach.c:89
An Index Window containing a selection list.
Definition: mutt_window.h:93
int attach_tag(struct Menu *menu, int sel, int act)
Tag an attachment - Implements Menu::tag()
Definition: recvattach.c:449
void mutt_window_free(struct MuttWindow **ptr)
Free a Window and its children.
Definition: mutt_window.c:150
#define SEND_NO_FLAGS
No flags are set.
Definition: send.h:87
void mutt_attach_reply(FILE *fp, struct Email *e, struct AttachCtx *actx, struct Body *e_cur, SendFlags flags)
Attach a reply.
Definition: recvcmd.c:903
int mx_msg_close(struct Mailbox *m, struct Message **msg)
Close a message.
Definition: mx.c:1181
struct Notify * notify
Notifications system.
Definition: mutt_window.h:123
struct Mailbox * mailbox
Definition: context.h:50
struct MuttWindow * win_ibar
Definition: mutt_menu.h:93
const char * title
Title of this menu.
Definition: mutt_menu.h:82
int parent_type
Type of parent attachment, e.g. TYPE_MULTIPART.
Definition: attach.h:38
struct AttachCtx * mutt_actx_new(void)
Create a new Attachment Context.
Definition: attach.c:131
#define SEND_LIST_REPLY
Reply to mailing list.
Definition: send.h:90
bool tagged
This attachment is tagged.
Definition: body.h:70
Window has a fixed size.
Definition: mutt_window.h:44
const char * help
Quickref for the current menu.
Definition: mutt_menu.h:83
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition: string.c:891
#define REDRAW_MOTION_RESYNC
Redraw any changing the menu selection.
Definition: mutt_menu.h:42
struct Notify * notify_new(void)
Create a new notifications handler.
Definition: notify.c:49
void mutt_attach_bounce(struct Mailbox *m, FILE *fp, struct AttachCtx *actx, struct Body *cur)
Bounce function, from the attachment menu.
Definition: recvcmd.c:168
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:113
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition: lib.h:137
&#39;POP3&#39; Mailbox type
Definition: mailbox.h:55
A local copy of an email.
Definition: mx.h:83
Select an attachment.
Definition: keymap.h:73
A mailbox.
Definition: mailbox.h:81
static void recvattach_edit_content_type(struct AttachCtx *actx, struct Menu *menu, struct Email *e)
Edit the content type of an attachment.
Definition: recvattach.c:1120
int mutt_attach_display_loop(struct Menu *menu, int op, struct Email *e, struct AttachCtx *actx, bool recv)
Event loop for the Attachment menu.
Definition: recvattach.c:1150
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
Definition: mutt_window.h:49
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:58
bool tagprefix
Definition: mutt_menu.h:90
static void recvattach_extract_pgp_keys(struct AttachCtx *actx, struct Menu *menu)
Extract PGP keys from attachments.
Definition: recvattach.c:1074
WHERE bool C_Resolve
Config: Move to the next email whenever a command modifies an email.
Definition: globals.h:238
static void mutt_update_recvattach_menu(struct AttachCtx *actx, struct Menu *menu, bool init)
Update the Attachment Menu.
Definition: recvattach.c:1358
#define SEND_NEWS
Reply to a news article.
Definition: send.h:102
int(* tag)(struct Menu *menu, int sel, int act)
Tag some menu items.
Definition: mutt_menu.h:136
int pagelen
Number of entries per screen.
Definition: mutt_menu.h:89
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib...
Definition: email.h:39
static int recvattach_pgp_check_traditional(struct AttachCtx *actx, struct Menu *menu)
Is the Attachment inline PGP?
Definition: recvattach.c:1098
Force viewing using mailcap entry.
Definition: mutt_attach.h:43
#define SEND_REPLY
Reply to sender.
Definition: send.h:88
#define CHECK_READONLY
Definition: recvattach.c:81
int max
Number of entries in the menu.
Definition: mutt_menu.h:86
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
Definition: mutt_window.c:564
void mutt_print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, struct Body *top)
Print a list of Attachments.
Definition: recvattach.c:1031
MuttRedrawFlags redraw
When to redraw the screen.
Definition: mutt_menu.h:87
void mutt_attach_forward(FILE *fp, struct Email *e, struct AttachCtx *actx, struct Body *cur, SendFlags flags)
Forward an Attachment.
Definition: recvcmd.c:756
#define SEC_SIGN
Email is signed.
Definition: lib.h:126
bool deleted
Attachment marked for deletion.
Definition: body.h:71
static void attach_collapse(struct AttachCtx *actx, struct Menu *menu)
Close the tree of the current attachment.
Definition: recvattach.c:1383
#define SEND_GROUP_REPLY
Reply to all.
Definition: send.h:89
Type: &#39;multipart/*&#39;.
Definition: mime.h:37
#define REDRAW_INDEX
Redraw the index.
Definition: mutt_menu.h:40
struct Body * content
Attachment.
Definition: attach.h:36
#define mutt_error(...)
Definition: logging.h:84
FILE * fp
pointer to the message data
Definition: mx.h:85
void mutt_save_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, struct Body *top, struct Email *e, struct Menu *menu)
Save a list of attachments.
Definition: recvattach.c:650
void mutt_attach_mail_sender(FILE *fp, struct Email *e, struct AttachCtx *actx, struct Body *cur)
Compose an email to the sender in the email attachment.
Definition: recvcmd.c:1073
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
Definition: notify.c:82
void mutt_message_hook(struct Mailbox *m, struct Email *e, HookFlags type)
Perform a message hook.
Definition: hook.c:573
struct MuttWindow * mutt_window_new(enum WindowType type, enum MuttWindowOrientation orient, enum MuttWindowSize size, int cols, int rows)
Create a new Window.
Definition: mutt_window.c:131
#define SEND_GROUP_CHAT_REPLY
Reply to all recipients preserving To/Cc.
Definition: send.h:101
int current
Current entry.
Definition: mutt_menu.h:85
struct MuttWindow * win_index
Definition: mutt_menu.h:92
char * mutt_compile_help(char *buf, size_t buflen, enum MenuType menu, const struct Mapping *items)
Create the text for the help menu.
Definition: help.c:110
Window wants as much space as possible.
Definition: mutt_window.h:45
#define CHECK_ATTACH
Definition: recvattach.c:99
Index Bar containing status info about the Index.
Definition: mutt_window.h:94
A set of attachments.
Definition: attach.h:49
struct AttachPtr ** idx
Array of attachments.
Definition: attach.h:54
SecurityFlags crypt_query(struct Body *m)
Check out the type of encryption used.
Definition: crypt.c:695
void(* make_entry)(char *buf, size_t buflen, struct Menu *menu, int line)
Format a item for a menu.
Definition: mutt_menu.h:117
void mutt_attach_resend(FILE *fp, struct AttachCtx *actx, struct Body *cur)
resend-message, from the attachment menu
Definition: recvcmd.c:291
struct Message * mx_msg_open(struct Mailbox *m, int msgno)
return a stream pointer for a message
Definition: mx.c:1133
#define SEC_PARTSIGN
Not all parts of the email is signed.
Definition: lib.h:129
#define REDRAW_CURRENT
Redraw the current line of the menu.
Definition: mutt_menu.h:43
void mutt_pipe_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, struct Body *top, bool filter)
Pipe a list of attachments to a command.
Definition: recvattach.c:876
int msgno
Number displayed to the user.
Definition: email.h:86
int mutt_view_attachment(FILE *fp, struct Body *a, enum ViewAttachMode mode, struct Email *e, struct AttachCtx *actx, struct MuttWindow *win)
View an attachment.
Definition: mutt_attach.c:415
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_generate_recvattach_list()

void mutt_generate_recvattach_list ( struct AttachCtx actx,
struct Email e,
struct Body parts,
FILE *  fp,
int  parent_type,
int  level,
bool  decrypted 
)

Create a list of attachments.

Parameters
actxAttachment context
eEmail
partsBody of email
fpFile to read from
parent_typeType, e.g. TYPE_MULTIPART
levelAttachment depth
decryptedTrue if attachment has been decrypted

Definition at line 1228 of file recvattach.c.

1231 {
1232  struct Body *m = NULL;
1233  struct Body *new_body = NULL;
1234  FILE *fp_new = NULL;
1236  int need_secured, secured;
1237 
1238  for (m = parts; m; m = m->next)
1239  {
1240  need_secured = 0;
1241  secured = 0;
1242 
1243  if (((WithCrypto & APPLICATION_SMIME) != 0) && (type = mutt_is_application_smime(m)))
1244  {
1245  need_secured = 1;
1246 
1247  if (type & SEC_ENCRYPT)
1248  {
1249  if (!crypt_valid_passphrase(APPLICATION_SMIME))
1250  goto decrypt_failed;
1251 
1252  if (e->env)
1254  }
1255 
1256  secured = !crypt_smime_decrypt_mime(fp, &fp_new, m, &new_body);
1257  /* If the decrypt/verify-opaque doesn't generate mime output, an empty
1258  * text/plain type will still be returned by mutt_read_mime_header().
1259  * We can't distinguish an actual part from a failure, so only use a
1260  * text/plain that results from a single top-level part. */
1261  if (secured && (new_body->type == TYPE_TEXT) &&
1262  mutt_istr_equal("plain", new_body->subtype) && ((parts != m) || m->next))
1263  {
1264  mutt_body_free(&new_body);
1265  mutt_file_fclose(&fp_new);
1266  goto decrypt_failed;
1267  }
1268 
1269  if (secured && (type & SEC_ENCRYPT))
1270  e->security |= SMIME_ENCRYPT;
1271  }
1272 
1273  if (((WithCrypto & APPLICATION_PGP) != 0) &&
1275  {
1276  need_secured = 1;
1277 
1278  if (!crypt_valid_passphrase(APPLICATION_PGP))
1279  goto decrypt_failed;
1280 
1281  secured = !crypt_pgp_decrypt_mime(fp, &fp_new, m, &new_body);
1282 
1283  if (secured)
1284  e->security |= PGP_ENCRYPT;
1285  }
1286 
1287  if (need_secured && secured)
1288  {
1289  mutt_actx_add_fp(actx, fp_new);
1290  mutt_actx_add_body(actx, new_body);
1291  mutt_generate_recvattach_list(actx, e, new_body, fp_new, parent_type, level, 1);
1292  continue;
1293  }
1294 
1295  decrypt_failed:
1296  /* Fall through and show the original parts if decryption fails */
1297  if (need_secured && !secured)
1298  mutt_error(_("Can't decrypt encrypted message"));
1299 
1300  /* Strip out the top level multipart */
1301  if ((m->type == TYPE_MULTIPART) && m->parts && !need_secured &&
1302  ((parent_type == -1) && !mutt_istr_equal("alternative", m->subtype)))
1303  {
1304  mutt_generate_recvattach_list(actx, e, m->parts, fp, m->type, level, decrypted);
1305  }
1306  else
1307  {
1308  struct AttachPtr *ap = mutt_mem_calloc(1, sizeof(struct AttachPtr));
1309  mutt_actx_add_attach(actx, ap);
1310 
1311  ap->content = m;
1312  ap->fp = fp;
1313  m->aptr = ap;
1314  ap->parent_type = parent_type;
1315  ap->level = level;
1316  ap->decrypted = decrypted;
1317 
1318  if (m->type == TYPE_MULTIPART)
1319  mutt_generate_recvattach_list(actx, e, m->parts, fp, m->type, level + 1, decrypted);
1320  else if (mutt_is_message_type(m->type, m->subtype))
1321  {
1322  mutt_generate_recvattach_list(actx, m->email, m->parts, fp, m->type,
1323  level + 1, decrypted);
1324  e->security |= m->email->security;
1325  }
1326  }
1327  }
1328 }
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
An email to which things will be attached.
Definition: attach.h:34
#define WithCrypto
Definition: lib.h:163
bool mutt_is_message_type(int type, const char *subtype)
Determine if a mime type matches a message or not.
Definition: parse.c:1360
void mutt_actx_add_fp(struct AttachCtx *actx, FILE *fp_new)
Save a File handle to the Attachment Context.
Definition: attach.c:62
void mutt_generate_recvattach_list(struct AttachCtx *actx, struct Email *e, struct Body *parts, FILE *fp, int parent_type, int level, bool decrypted)
Create a list of attachments.
Definition: recvattach.c:1228
#define SMIME_ENCRYPT
Definition: lib.h:149
#define SEC_ENCRYPT
Email is encrypted.
Definition: lib.h:125
#define PGP_ENCRYPT
Definition: lib.h:143
#define _(a)
Definition: message.h:28
struct Body * next
next attachment in the list
Definition: body.h:53
void mutt_actx_add_attach(struct AttachCtx *actx, struct AttachPtr *attach)
Add an Attachment to an Attachment Context.
Definition: attach.c:40
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
Definition: lib.h:123
The body of an email.
Definition: body.h:34
bool crypt_valid_passphrase(SecurityFlags flags)
Check that we have a usable passphrase, ask if not.
Definition: crypt.c:146
SecurityFlags mutt_is_multipart_encrypted(struct Body *b)
Does the message have encrypted parts?
Definition: crypt.c:457
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
Definition: file.c:153
int parent_type
Type of parent attachment, e.g. TYPE_MULTIPART.
Definition: attach.h:38
struct Envelope * env
Envelope information.
Definition: email.h:89
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition: string.c:891
char * subtype
content-type subtype
Definition: body.h:37
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
Definition: lib.h:138
bool decrypted
Not part of message as stored in the email->content.
Definition: attach.h:43
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition: lib.h:137
struct AttachPtr * aptr
Menu information, used in recvattach.c.
Definition: body.h:57
Type: &#39;text/*&#39;.
Definition: mime.h:38
void crypt_smime_getkeys(struct Envelope *env)
Wrapper for CryptModuleSpecs::smime_getkeys()
Definition: cryptglue.c:460
struct Body * parts
parts of a multipart or message/rfc822
Definition: body.h:54
FILE * fp
Used in the recvattach menu.
Definition: attach.h:37
SecurityFlags mutt_is_malformed_multipart_pgp_encrypted(struct Body *b)
Check for malformed layout.
Definition: crypt.c:518
int crypt_smime_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur)
Wrapper for CryptModuleSpecs::decrypt_mime()
Definition: cryptglue.c:436
SecurityFlags mutt_is_application_smime(struct Body *m)
Does the message use S/MIME?
Definition: crypt.c:620
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib...
Definition: email.h:39
unsigned int type
content-type primary type, ContentType
Definition: body.h:65
int crypt_pgp_decrypt_mime(FILE *fp_in, FILE **fp_out, struct Body *b, struct Body **cur)
Wrapper for CryptModuleSpecs::decrypt_mime()
Definition: cryptglue.c:212
Type: &#39;multipart/*&#39;.
Definition: mime.h:37
struct Body * content
Attachment.
Definition: attach.h:36
#define mutt_error(...)
Definition: logging.h:84
void mutt_body_free(struct Body **ptr)
Free a Body.
Definition: body.c:57
struct Email * email
header information for message/rfc822
Definition: body.h:55
int level
Nesting depth of attachment.
Definition: attach.h:40
void mutt_actx_add_body(struct AttachCtx *actx, struct Body *new_body)
Add an email box to an Attachment Context.
Definition: attach.c:83
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ C_AttachSaveDir

char* C_AttachSaveDir

Config: Default directory where attachments are saved.

Definition at line 70 of file recvattach.c.

◆ C_AttachSaveWithoutPrompting

char* C_AttachSaveWithoutPrompting

Config: If true, then don't prompt to save.

Definition at line 71 of file recvattach.c.

◆ C_AttachSep

char* C_AttachSep

Config: Separator to add between saved/printed/piped attachments.

Definition at line 72 of file recvattach.c.

◆ C_AttachSplit

bool C_AttachSplit

Config: Save/print/pipe tagged messages individually.

Definition at line 73 of file recvattach.c.

◆ C_DigestCollapse

bool C_DigestCollapse

Config: Hide the subparts of a multipart/digest.

Definition at line 74 of file recvattach.c.

◆ C_MessageFormat

char* C_MessageFormat

Config: printf-like format string for listing attached messages.

Definition at line 75 of file recvattach.c.