NeoMutt  2021-02-05-89-gabe350
Teaching an old dog new tricks
DOXYGEN
lib.h File Reference
#include <stdint.h>
+ Include dependency graph for lib.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MUTT_COMPOSE_NOFREEHEADER   (1 << 0)
 

Functions

int mutt_compose_menu (struct Email *e, struct Buffer *fcc, struct Email *e_cur, uint8_t flags, struct ConfigSubset *sub)
 Allow the user to edit the message envelope. More...
 

Detailed Description

GUI editor for an email's headers

Authors
  • Richard Russon

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

Macro Definition Documentation

◆ MUTT_COMPOSE_NOFREEHEADER

#define MUTT_COMPOSE_NOFREEHEADER   (1 << 0)

Definition at line 43 of file lib.h.

Function Documentation

◆ mutt_compose_menu()

int mutt_compose_menu ( struct Email e,
struct Buffer fcc,
struct Email e_cur,
uint8_t  flags,
struct ConfigSubset sub 
)

Allow the user to edit the message envelope.

Parameters
eEmail to fill
fccBuffer to save FCC
e_curCurrent message
flagsFlags, e.g. MUTT_COMPOSE_NOFREEHEADER
subConfigSubset
Return values
1Message should be postponed
0Normal exit
-1Abort message

Definition at line 1474 of file compose.c.

1476 {
1477  char buf[PATH_MAX];
1478  int rc = -1;
1479  bool loop = true;
1480  bool fcc_set = false; /* has the user edited the Fcc: field ? */
1481  struct ComposeRedrawData redraw = { 0 };
1482 
1483  STAILQ_INIT(&redraw.to_list);
1484  STAILQ_INIT(&redraw.cc_list);
1485  STAILQ_INIT(&redraw.bcc_list);
1486 
1487  struct ComposeRedrawData *rd = &redraw;
1488 #ifdef USE_NNTP
1489  bool news = OptNewsSend; /* is it a news article ? */
1490 #endif
1491 
1493 
1494  struct MuttWindow *dlg =
1497 
1498  struct MuttWindow *envelope =
1501 
1502  struct MuttWindow *abar =
1505 
1506  struct MuttWindow *attach =
1509 
1510  struct MuttWindow *ebar =
1513 
1514  rd->email = e;
1515  rd->fcc = fcc;
1516  rd->win_envelope = envelope;
1517  rd->win_cbar = ebar;
1518  rd->win_attach = attach;
1519  rd->win_abar = abar;
1520  rd->sub = sub;
1521 
1522  const bool c_status_on_top = cs_subset_bool(sub, "status_on_top");
1523  if (c_status_on_top)
1524  {
1525  mutt_window_add_child(dlg, ebar);
1526  mutt_window_add_child(dlg, envelope);
1527  mutt_window_add_child(dlg, abar);
1528  mutt_window_add_child(dlg, attach);
1529  }
1530  else
1531  {
1532  mutt_window_add_child(dlg, envelope);
1533  mutt_window_add_child(dlg, abar);
1534  mutt_window_add_child(dlg, attach);
1535  mutt_window_add_child(dlg, ebar);
1536  }
1537 
1540  dialog_push(dlg);
1541 
1542 #ifdef USE_NNTP
1543  if (news)
1544  dlg->help_data = ComposeNewsHelp;
1545  else
1546 #endif
1547  dlg->help_data = ComposeHelp;
1548  dlg->help_menu = MENU_COMPOSE;
1549 
1550  envelope->req_rows = calc_envelope(rd);
1551  mutt_window_reflow(dlg);
1552 
1553  struct Menu *menu = mutt_menu_new(MENU_COMPOSE);
1554 
1555  menu->pagelen = attach->state.rows;
1556  menu->win_index = attach;
1557  menu->win_ibar = ebar;
1558 
1559  menu->make_entry = snd_make_entry;
1560  menu->tag = attach_tag;
1562  menu->redraw_data = rd;
1563  mutt_menu_push_current(menu);
1564 
1565  struct AttachCtx *actx = mutt_actx_new();
1566  actx->email = e;
1567  mutt_update_compose_menu(actx, menu, true);
1568 
1569  update_crypt_info(rd);
1570 
1571  /* Since this is rather long lived, we don't use the pool */
1572  struct Buffer fname = mutt_buffer_make(PATH_MAX);
1573 
1574  bool redraw_env = false;
1575  while (loop)
1576  {
1577  if (redraw_env)
1578  {
1579  redraw_env = false;
1580  envelope->req_rows = calc_envelope(rd);
1581  mutt_window_reflow(dlg);
1582  }
1583 
1584 #ifdef USE_NNTP
1585  OptNews = false; /* for any case */
1586 #endif
1587  const int op = mutt_menu_loop(menu);
1588  if (op >= 0)
1589  mutt_debug(LL_DEBUG1, "Got op %s (%d)\n", OpStrings[op][0], op);
1590  switch (op)
1591  {
1592  case OP_COMPOSE_EDIT_FROM:
1593  if (edit_address_list(HDR_FROM, &e->env->from))
1594  {
1595  update_crypt_info(rd);
1597  redraw_env = true;
1598  }
1599  break;
1600 
1601  case OP_COMPOSE_EDIT_TO:
1602  {
1603 #ifdef USE_NNTP
1604  if (news)
1605  break;
1606 #endif
1607  if (edit_address_list(HDR_TO, &e->env->to))
1608  {
1609  update_crypt_info(rd);
1611  redraw_env = true;
1612  }
1613  break;
1614  }
1615 
1616  case OP_COMPOSE_EDIT_BCC:
1617  {
1618 #ifdef USE_NNTP
1619  if (news)
1620  break;
1621 #endif
1622  if (edit_address_list(HDR_BCC, &e->env->bcc))
1623  {
1624  update_crypt_info(rd);
1626  redraw_env = true;
1627  }
1628  break;
1629  }
1630 
1631  case OP_COMPOSE_EDIT_CC:
1632  {
1633 #ifdef USE_NNTP
1634  if (news)
1635  break;
1636 #endif
1637  if (edit_address_list(HDR_CC, &e->env->cc))
1638  {
1639  update_crypt_info(rd);
1641  redraw_env = true;
1642  }
1643  break;
1644  }
1645 
1646 #ifdef USE_NNTP
1647  case OP_COMPOSE_EDIT_NEWSGROUPS:
1648  if (!news)
1649  break;
1650  mutt_str_copy(buf, e->env->newsgroups, sizeof(buf));
1651  if (mutt_get_field(Prompts[HDR_NEWSGROUPS], buf, sizeof(buf),
1652  MUTT_COMP_NO_FLAGS, false, NULL, NULL) == 0)
1653  {
1654  mutt_str_replace(&e->env->newsgroups, buf);
1655  redraw_env = true;
1656  }
1657  break;
1658 
1659  case OP_COMPOSE_EDIT_FOLLOWUP_TO:
1660  if (!news)
1661  break;
1662  mutt_str_copy(buf, e->env->followup_to, sizeof(buf));
1663  if (mutt_get_field(Prompts[HDR_FOLLOWUPTO], buf, sizeof(buf),
1664  MUTT_COMP_NO_FLAGS, false, NULL, NULL) == 0)
1665  {
1666  mutt_str_replace(&e->env->followup_to, buf);
1667  redraw_env = true;
1668  }
1669  break;
1670 
1671  case OP_COMPOSE_EDIT_X_COMMENT_TO:
1672  {
1673  const bool c_x_comment_to = cs_subset_bool(sub, "x_comment_to");
1674  if (!(news && c_x_comment_to))
1675  break;
1676  mutt_str_copy(buf, e->env->x_comment_to, sizeof(buf));
1677  if (mutt_get_field(Prompts[HDR_XCOMMENTTO], buf, sizeof(buf),
1678  MUTT_COMP_NO_FLAGS, false, NULL, NULL) == 0)
1679  {
1680  mutt_str_replace(&e->env->x_comment_to, buf);
1681  redraw_env = true;
1682  }
1683  break;
1684  }
1685 #endif
1686 
1687  case OP_COMPOSE_EDIT_SUBJECT:
1688  mutt_str_copy(buf, e->env->subject, sizeof(buf));
1689  if (mutt_get_field(Prompts[HDR_SUBJECT], buf, sizeof(buf),
1690  MUTT_COMP_NO_FLAGS, false, NULL, NULL) == 0)
1691  {
1692  if (!mutt_str_equal(e->env->subject, buf))
1693  {
1694  mutt_str_replace(&e->env->subject, buf);
1695  redraw_env = true;
1697  }
1698  }
1699  break;
1700 
1701  case OP_COMPOSE_EDIT_REPLY_TO:
1703  {
1705  redraw_env = true;
1706  }
1707  break;
1708 
1709  case OP_COMPOSE_EDIT_FCC:
1710  mutt_buffer_copy(&fname, fcc);
1712  false, NULL, NULL, NULL) == 0)
1713  {
1714  if (!mutt_str_equal(fcc->data, fname.data))
1715  {
1716  mutt_buffer_copy(fcc, &fname);
1718  fcc_set = true;
1719  redraw_env = true;
1721  }
1722  }
1723  break;
1724 
1725  case OP_COMPOSE_EDIT_MESSAGE:
1726  {
1727  const bool c_edit_headers = cs_subset_bool(sub, "edit_headers");
1728  if (!c_edit_headers)
1729  {
1731  const char *c_editor = cs_subset_string(sub, "editor");
1732  mutt_edit_file(c_editor, e->body->filename);
1734  mutt_update_encoding(e->body, sub);
1735  menu->redraw = REDRAW_FULL;
1736  /* Unconditional hook since editor was invoked */
1738  break;
1739  }
1740  }
1741  /* fallthrough */
1742 
1743  case OP_COMPOSE_EDIT_HEADERS:
1744  {
1746  const char *tag = NULL;
1747  char *err = NULL;
1748  mutt_env_to_local(e->env);
1749  const char *c_editor = cs_subset_string(sub, "editor");
1750  mutt_edit_headers(NONULL(c_editor), e->body->filename, e, fcc);
1751  if (mutt_env_to_intl(e->env, &tag, &err))
1752  {
1753  mutt_error(_("Bad IDN in '%s': '%s'"), tag, err);
1754  FREE(&err);
1755  }
1756  update_crypt_info(rd);
1757  redraw_env = true;
1758 
1760  mutt_update_encoding(e->body, sub);
1761 
1762  /* attachments may have been added */
1763  if (actx->idxlen && actx->idx[actx->idxlen - 1]->body->next)
1764  {
1765  mutt_actx_entries_free(actx);
1766  mutt_update_compose_menu(actx, menu, true);
1767  }
1768 
1769  menu->redraw = REDRAW_FULL;
1770  /* Unconditional hook since editor was invoked */
1772  break;
1773  }
1774 
1775  case OP_COMPOSE_ATTACH_KEY:
1776  {
1777  if (!(WithCrypto & APPLICATION_PGP))
1778  break;
1779  struct AttachPtr *ap = mutt_mem_calloc(1, sizeof(struct AttachPtr));
1781  if (ap->body)
1782  {
1783  update_idx(menu, actx, ap);
1784  menu->redraw |= REDRAW_INDEX;
1786  }
1787  else
1788  FREE(&ap);
1789 
1790  menu->redraw |= REDRAW_STATUS;
1791  break;
1792  }
1793 
1794  case OP_COMPOSE_MOVE_UP:
1795  if (menu->current == 0)
1796  {
1797  mutt_error(_("Attachment is already at top"));
1798  break;
1799  }
1800  if (menu->current == 1)
1801  {
1802  mutt_error(_("The fundamental part can't be moved"));
1803  break;
1804  }
1805  compose_attach_swap(e->body, actx->idx, menu->current - 1);
1806  menu->redraw |= REDRAW_INDEX;
1807  menu->current--;
1808  break;
1809 
1810  case OP_COMPOSE_MOVE_DOWN:
1811  if (menu->current == (actx->idxlen - 1))
1812  {
1813  mutt_error(_("Attachment is already at bottom"));
1814  break;
1815  }
1816  if (menu->current == 0)
1817  {
1818  mutt_error(_("The fundamental part can't be moved"));
1819  break;
1820  }
1821  compose_attach_swap(e->body, actx->idx, menu->current);
1822  menu->redraw |= REDRAW_INDEX;
1823  menu->current++;
1824  break;
1825 
1826  case OP_COMPOSE_GROUP_ALTS:
1827  {
1828  if (menu->tagged < 2)
1829  {
1830  mutt_error(
1831  _("Grouping 'alternatives' requires at least 2 tagged messages"));
1832  break;
1833  }
1834 
1835  struct Body *group = mutt_body_new();
1836  group->type = TYPE_MULTIPART;
1837  group->subtype = mutt_str_dup("alternative");
1838  group->disposition = DISP_INLINE;
1839 
1840  struct Body *alts = NULL;
1841  /* group tagged message into a multipart/alternative */
1842  struct Body *bptr = e->body;
1843  for (int i = 0; bptr;)
1844  {
1845  if (bptr->tagged)
1846  {
1847  bptr->tagged = false;
1848  bptr->disposition = DISP_INLINE;
1849 
1850  /* for first match, set group desc according to match */
1851 #define ALTS_TAG "Alternatives for \"%s\""
1852  if (!group->description)
1853  {
1854  char *p = bptr->description ? bptr->description : bptr->filename;
1855  if (p)
1856  {
1857  group->description =
1858  mutt_mem_calloc(1, strlen(p) + strlen(ALTS_TAG) + 1);
1859  sprintf(group->description, ALTS_TAG, p);
1860  }
1861  }
1862 
1863  // append bptr to the alts list, and remove from the e->body list
1864  if (alts)
1865  {
1866  alts->next = bptr;
1867  bptr = bptr->next;
1868  alts = alts->next;
1869  alts->next = NULL;
1870  }
1871  else
1872  {
1873  group->parts = bptr;
1874  alts = bptr;
1875  bptr = bptr->next;
1876  alts->next = NULL;
1877  }
1878 
1879  for (int j = i; j < actx->idxlen - 1; j++)
1880  {
1881  actx->idx[j] = actx->idx[j + 1];
1882  actx->idx[j + 1] = NULL; /* for debug reason */
1883  }
1884  actx->idxlen--;
1885  }
1886  else
1887  {
1888  bptr = bptr->next;
1889  i++;
1890  }
1891  }
1892 
1893  group->next = NULL;
1895 
1896  /* if no group desc yet, make one up */
1897  if (!group->description)
1898  group->description = mutt_str_dup("unknown alternative group");
1899 
1900  struct AttachPtr *gptr = mutt_mem_calloc(1, sizeof(struct AttachPtr));
1901  gptr->body = group;
1902  update_idx(menu, actx, gptr);
1903  menu->redraw |= REDRAW_INDEX;
1904  break;
1905  }
1906 
1907  case OP_COMPOSE_GROUP_LINGUAL:
1908  {
1909  if (menu->tagged < 2)
1910  {
1911  mutt_error(
1912  _("Grouping 'multilingual' requires at least 2 tagged messages"));
1913  break;
1914  }
1915 
1916  /* traverse to see whether all the parts have Content-Language: set */
1917  int tagged_with_lang_num = 0;
1918  for (struct Body *b = e->body; b; b = b->next)
1919  if (b->tagged && b->language && *b->language)
1920  tagged_with_lang_num++;
1921 
1922  if (menu->tagged != tagged_with_lang_num)
1923  {
1924  if (mutt_yesorno(
1925  _("Not all parts have 'Content-Language' set, continue?"), MUTT_YES) != MUTT_YES)
1926  {
1927  mutt_message(_("Not sending this message"));
1928  break;
1929  }
1930  }
1931 
1932  struct Body *group = mutt_body_new();
1933  group->type = TYPE_MULTIPART;
1934  group->subtype = mutt_str_dup("multilingual");
1935  group->disposition = DISP_INLINE;
1936 
1937  struct Body *alts = NULL;
1938  /* group tagged message into a multipart/multilingual */
1939  struct Body *bptr = e->body;
1940  for (int i = 0; bptr;)
1941  {
1942  if (bptr->tagged)
1943  {
1944  bptr->tagged = false;
1945  bptr->disposition = DISP_INLINE;
1946 
1947  /* for first match, set group desc according to match */
1948 #define LINGUAL_TAG "Multilingual part for \"%s\""
1949  if (!group->description)
1950  {
1951  char *p = bptr->description ? bptr->description : bptr->filename;
1952  if (p)
1953  {
1954  group->description =
1955  mutt_mem_calloc(1, strlen(p) + strlen(LINGUAL_TAG) + 1);
1956  sprintf(group->description, LINGUAL_TAG, p);
1957  }
1958  }
1959 
1960  // append bptr to the alts list, and remove from the e->body list
1961  if (alts)
1962  {
1963  alts->next = bptr;
1964  bptr = bptr->next;
1965  alts = alts->next;
1966  alts->next = NULL;
1967  }
1968  else
1969  {
1970  group->parts = bptr;
1971  alts = bptr;
1972  bptr = bptr->next;
1973  alts->next = NULL;
1974  }
1975 
1976  for (int j = i; j < actx->idxlen - 1; j++)
1977  {
1978  actx->idx[j] = actx->idx[j + 1];
1979  actx->idx[j + 1] = NULL; /* for debug reason */
1980  }
1981  actx->idxlen--;
1982  }
1983  else
1984  {
1985  bptr = bptr->next;
1986  i++;
1987  }
1988  }
1989 
1990  group->next = NULL;
1992 
1993  /* if no group desc yet, make one up */
1994  if (!group->description)
1995  group->description = mutt_str_dup("unknown multilingual group");
1996 
1997  struct AttachPtr *gptr = mutt_mem_calloc(1, sizeof(struct AttachPtr));
1998  gptr->body = group;
1999  update_idx(menu, actx, gptr);
2000  menu->redraw |= REDRAW_INDEX;
2001  break;
2002  }
2003 
2004  case OP_COMPOSE_ATTACH_FILE:
2005  {
2006  char *prompt = _("Attach file");
2007  int numfiles = 0;
2008  char **files = NULL;
2009 
2010  mutt_buffer_reset(&fname);
2011  if ((mutt_buffer_enter_fname(prompt, &fname, false, NULL, true, &files,
2012  &numfiles, MUTT_SEL_MULTI) == -1) ||
2013  mutt_buffer_is_empty(&fname))
2014  {
2015  for (int i = 0; i < numfiles; i++)
2016  FREE(&files[i]);
2017 
2018  FREE(&files);
2019  break;
2020  }
2021 
2022  bool error = false;
2023  bool added_attachment = false;
2024  if (numfiles > 1)
2025  {
2026  mutt_message(ngettext("Attaching selected file...",
2027  "Attaching selected files...", numfiles));
2028  }
2029  for (int i = 0; i < numfiles; i++)
2030  {
2031  char *att = files[i];
2032  struct AttachPtr *ap = mutt_mem_calloc(1, sizeof(struct AttachPtr));
2033  ap->unowned = true;
2034  ap->body = mutt_make_file_attach(att, sub);
2035  if (ap->body)
2036  {
2037  added_attachment = true;
2038  update_idx(menu, actx, ap);
2039  }
2040  else
2041  {
2042  error = true;
2043  mutt_error(_("Unable to attach %s"), att);
2044  FREE(&ap);
2045  }
2046  FREE(&files[i]);
2047  }
2048 
2049  FREE(&files);
2050  if (!error)
2051  mutt_clear_error();
2052 
2053  menu->redraw |= REDRAW_INDEX | REDRAW_STATUS;
2054  if (added_attachment)
2056  break;
2057  }
2058 
2059  case OP_COMPOSE_ATTACH_MESSAGE:
2060 #ifdef USE_NNTP
2061  case OP_COMPOSE_ATTACH_NEWS_MESSAGE:
2062 #endif
2063  {
2064  mutt_buffer_reset(&fname);
2065  char *prompt = _("Open mailbox to attach message from");
2066 
2067 #ifdef USE_NNTP
2068  OptNews = false;
2069  if (Context && (op == OP_COMPOSE_ATTACH_NEWS_MESSAGE))
2070  {
2071  const char *c_news_server = cs_subset_string(sub, "news_server");
2072  CurrentNewsSrv = nntp_select_server(Context->mailbox, c_news_server, false);
2073  if (!CurrentNewsSrv)
2074  break;
2075 
2076  prompt = _("Open newsgroup to attach message from");
2077  OptNews = true;
2078  }
2079 #endif
2080 
2081  if (Context)
2082  {
2083 #ifdef USE_NNTP
2084  if ((op == OP_COMPOSE_ATTACH_MESSAGE) ^ (Context->mailbox->type == MUTT_NNTP))
2085 #endif
2086  {
2089  }
2090  }
2091 
2092  if ((mutt_buffer_enter_fname(prompt, &fname, true, ctx_mailbox(Context),
2093  false, NULL, NULL, MUTT_SEL_NO_FLAGS) == -1) ||
2094  mutt_buffer_is_empty(&fname))
2095  {
2096  break;
2097  }
2098 
2099 #ifdef USE_NNTP
2100  if (OptNews)
2102  else
2103 #endif
2104  mutt_buffer_expand_path(&fname);
2105 #ifdef USE_IMAP
2106  if (imap_path_probe(mutt_buffer_string(&fname), NULL) != MUTT_IMAP)
2107 #endif
2108 #ifdef USE_POP
2109  if (pop_path_probe(mutt_buffer_string(&fname), NULL) != MUTT_POP)
2110 #endif
2111 #ifdef USE_NNTP
2112  if (!OptNews && (nntp_path_probe(mutt_buffer_string(&fname), NULL) != MUTT_NNTP))
2113 #endif
2115  {
2116  /* check to make sure the file exists and is readable */
2117  if (access(mutt_buffer_string(&fname), R_OK) == -1)
2118  {
2120  break;
2121  }
2122  }
2123 
2124  menu->redraw = REDRAW_FULL;
2125 
2126  struct Mailbox *m = mx_path_resolve(mutt_buffer_string(&fname));
2127  bool old_readonly = m->readonly;
2128  struct Context *ctx = mx_mbox_open(m, MUTT_READONLY);
2129  if (!ctx)
2130  {
2131  mutt_error(_("Unable to open mailbox %s"), mutt_buffer_string(&fname));
2133  m = NULL;
2134  break;
2135  }
2136 
2137  if (ctx->mailbox->msg_count == 0)
2138  {
2139  mx_mbox_close(&ctx);
2140  mutt_error(_("No messages in that folder"));
2141  break;
2142  }
2143 
2144  struct Context *ctx_cur = Context; /* remember current folder and sort methods */
2145  const enum SortType old_sort = cs_subset_sort(sub, "sort"); /* `$sort`, `$sort_aux` could be changed in mutt_index_menu() */
2146  const enum SortType old_sort_aux = cs_subset_sort(sub, "sort_aux");
2147 
2148  Context = ctx;
2149  OptAttachMsg = true;
2150  mutt_message(_("Tag the messages you want to attach"));
2151  struct MuttWindow *dlgindex = index_pager_init();
2152  dialog_push(dlgindex);
2153  mutt_index_menu(dlgindex);
2154  dialog_pop();
2155  index_pager_shutdown(dlgindex);
2156  mutt_window_free(&dlgindex);
2157  OptAttachMsg = false;
2158 
2159  if (!Context)
2160  {
2161  /* go back to the folder we started from */
2162  Context = ctx_cur;
2163  /* Restore old $sort and $sort_aux */
2164  if (old_sort != cs_subset_sort(sub, "sort"))
2165  cs_subset_str_native_set(sub, "sort", old_sort, NULL);
2166  if (old_sort_aux != cs_subset_sort(sub, "sort_aux"))
2167  cs_subset_str_native_set(sub, "sort_aux", old_sort_aux, NULL);
2168  menu->redraw |= REDRAW_INDEX | REDRAW_STATUS;
2169  break;
2170  }
2171 
2172  bool added_attachment = false;
2173  for (int i = 0; i < Context->mailbox->msg_count; i++)
2174  {
2175  if (!Context->mailbox->emails[i])
2176  break;
2178  continue;
2179 
2180  struct AttachPtr *ap = mutt_mem_calloc(1, sizeof(struct AttachPtr));
2182  Context->mailbox->emails[i], true, sub);
2183  if (ap->body)
2184  {
2185  added_attachment = true;
2186  update_idx(menu, actx, ap);
2187  }
2188  else
2189  {
2190  mutt_error(_("Unable to attach"));
2191  FREE(&ap);
2192  }
2193  }
2194  menu->redraw |= REDRAW_FULL;
2195 
2196  Context->mailbox->readonly = old_readonly;
2198  ctx_free(&Context);
2199 
2200  /* go back to the folder we started from */
2201  Context = ctx_cur;
2202  /* Restore old $sort and $sort_aux */
2203  if (old_sort != cs_subset_sort(sub, "sort"))
2204  cs_subset_str_native_set(sub, "sort", old_sort, NULL);
2205  if (old_sort_aux != cs_subset_sort(sub, "sort_aux"))
2206  cs_subset_str_native_set(sub, "sort_aux", old_sort_aux, NULL);
2207  if (added_attachment)
2209  break;
2210  }
2211 
2212  case OP_DELETE:
2213  CHECK_COUNT;
2214  if (CUR_ATTACH->unowned)
2215  CUR_ATTACH->body->unlink = false;
2216  if (delete_attachment(actx, menu->current) == -1)
2217  break;
2218  mutt_update_compose_menu(actx, menu, false);
2219  if (menu->current == 0)
2220  e->body = actx->idx[0]->body;
2221 
2223  break;
2224 
2225  case OP_COMPOSE_TOGGLE_RECODE:
2226  {
2227  CHECK_COUNT;
2228  if (!mutt_is_text_part(CUR_ATTACH->body))
2229  {
2230  mutt_error(_("Recoding only affects text attachments"));
2231  break;
2232  }
2233  CUR_ATTACH->body->noconv = !CUR_ATTACH->body->noconv;
2234  if (CUR_ATTACH->body->noconv)
2235  mutt_message(_("The current attachment won't be converted"));
2236  else
2237  mutt_message(_("The current attachment will be converted"));
2238  menu->redraw |= REDRAW_CURRENT;
2240  break;
2241  }
2242 
2243  case OP_COMPOSE_EDIT_DESCRIPTION:
2244  CHECK_COUNT;
2245  mutt_str_copy(buf, CUR_ATTACH->body->description, sizeof(buf));
2246  /* header names should not be translated */
2247  if (mutt_get_field("Description: ", buf, sizeof(buf),
2248  MUTT_COMP_NO_FLAGS, false, NULL, NULL) == 0)
2249  {
2250  if (!mutt_str_equal(CUR_ATTACH->body->description, buf))
2251  {
2252  mutt_str_replace(&CUR_ATTACH->body->description, buf);
2253  menu->redraw |= REDRAW_CURRENT;
2255  }
2256  }
2257  break;
2258 
2259  case OP_COMPOSE_UPDATE_ENCODING:
2260  {
2261  CHECK_COUNT;
2262  bool encoding_updated = false;
2263  if (menu->tagprefix)
2264  {
2265  struct Body *top = NULL;
2266  for (top = e->body; top; top = top->next)
2267  {
2268  if (top->tagged)
2269  {
2270  encoding_updated = true;
2271  mutt_update_encoding(top, sub);
2272  }
2273  }
2274  menu->redraw = REDRAW_FULL;
2275  }
2276  else
2277  {
2278  mutt_update_encoding(CUR_ATTACH->body, sub);
2279  encoding_updated = true;
2280  menu->redraw |= REDRAW_CURRENT | REDRAW_STATUS;
2281  }
2282  if (encoding_updated)
2284  break;
2285  }
2286 
2287  case OP_COMPOSE_TOGGLE_DISPOSITION:
2288  /* toggle the content-disposition between inline/attachment */
2289  CUR_ATTACH->body->disposition =
2290  (CUR_ATTACH->body->disposition == DISP_INLINE) ? DISP_ATTACH : DISP_INLINE;
2291  menu->redraw |= REDRAW_CURRENT;
2292  break;
2293 
2294  case OP_EDIT_TYPE:
2295  CHECK_COUNT;
2296  {
2297  if (mutt_edit_content_type(NULL, CUR_ATTACH->body, NULL))
2298  {
2299  /* this may have been a change to text/something */
2300  mutt_update_encoding(CUR_ATTACH->body, sub);
2301  menu->redraw |= REDRAW_CURRENT;
2303  }
2304  }
2305  break;
2306 
2307  case OP_COMPOSE_EDIT_LANGUAGE:
2308  CHECK_COUNT;
2309  mutt_str_copy(buf, CUR_ATTACH->body->language, sizeof(buf));
2310  if (mutt_get_field("Content-Language: ", buf, sizeof(buf),
2311  MUTT_COMP_NO_FLAGS, false, NULL, NULL) == 0)
2312  {
2313  if (!mutt_str_equal(CUR_ATTACH->body->language, buf))
2314  {
2315  CUR_ATTACH->body->language = mutt_str_dup(buf);
2316  menu->redraw |= REDRAW_CURRENT | REDRAW_STATUS;
2318  }
2319  mutt_clear_error();
2320  }
2321  else
2322  mutt_warning(_("Empty 'Content-Language'"));
2323  break;
2324 
2325  case OP_COMPOSE_EDIT_ENCODING:
2326  CHECK_COUNT;
2327  mutt_str_copy(buf, ENCODING(CUR_ATTACH->body->encoding), sizeof(buf));
2328  if ((mutt_get_field("Content-Transfer-Encoding: ", buf, sizeof(buf),
2329  MUTT_COMP_NO_FLAGS, false, NULL, NULL) == 0) &&
2330  (buf[0] != '\0'))
2331  {
2332  int enc = mutt_check_encoding(buf);
2333  if ((enc != ENC_OTHER) && (enc != ENC_UUENCODED))
2334  {
2335  if (enc != CUR_ATTACH->body->encoding)
2336  {
2337  CUR_ATTACH->body->encoding = enc;
2338  menu->redraw |= REDRAW_CURRENT | REDRAW_STATUS;
2339  mutt_clear_error();
2341  }
2342  }
2343  else
2344  mutt_error(_("Invalid encoding"));
2345  }
2346  break;
2347 
2348  case OP_COMPOSE_SEND_MESSAGE:
2349  /* Note: We don't invoke send2-hook here, since we want to leave
2350  * users an opportunity to change settings from the ":" prompt. */
2351  if (check_attachments(actx, sub) != 0)
2352  {
2353  menu->redraw = REDRAW_FULL;
2354  break;
2355  }
2356 
2357 #ifdef MIXMASTER
2358  if (!STAILQ_EMPTY(&e->chain) && (mix_check_message(e) != 0))
2359  break;
2360 #endif
2361 
2362  if (!fcc_set && !mutt_buffer_is_empty(fcc))
2363  {
2364  const enum QuadOption c_copy = cs_subset_quad(sub, "copy");
2365  enum QuadOption ans =
2366  query_quadoption(c_copy, _("Save a copy of this message?"));
2367  if (ans == MUTT_ABORT)
2368  break;
2369  else if (ans == MUTT_NO)
2370  mutt_buffer_reset(fcc);
2371  }
2372 
2373  loop = false;
2374  rc = 0;
2375  break;
2376 
2377  case OP_COMPOSE_EDIT_FILE:
2378  {
2379  CHECK_COUNT;
2380  const char *c_editor = cs_subset_string(sub, "editor");
2381  mutt_edit_file(NONULL(c_editor), CUR_ATTACH->body->filename);
2382  mutt_update_encoding(CUR_ATTACH->body, sub);
2383  menu->redraw |= REDRAW_CURRENT | REDRAW_STATUS;
2384  /* Unconditional hook since editor was invoked */
2386  break;
2387  }
2388 
2389  case OP_COMPOSE_TOGGLE_UNLINK:
2390  CHECK_COUNT;
2391  CUR_ATTACH->body->unlink = !CUR_ATTACH->body->unlink;
2392 
2393  menu->redraw |= REDRAW_INDEX;
2394  /* No send2hook since this doesn't change the message. */
2395  break;
2396 
2397  case OP_COMPOSE_GET_ATTACHMENT:
2398  CHECK_COUNT;
2399  if (menu->tagprefix)
2400  {
2401  for (struct Body *top = e->body; top; top = top->next)
2402  {
2403  if (top->tagged)
2405  }
2406  menu->redraw |= REDRAW_FULL;
2407  }
2408  else if (mutt_get_tmp_attachment(CUR_ATTACH->body) == 0)
2409  menu->redraw |= REDRAW_CURRENT;
2410 
2411  /* No send2hook since this doesn't change the message. */
2412  break;
2413 
2414  case OP_COMPOSE_RENAME_ATTACHMENT:
2415  {
2416  CHECK_COUNT;
2417  char *src = NULL;
2418  if (CUR_ATTACH->body->d_filename)
2419  src = CUR_ATTACH->body->d_filename;
2420  else
2421  src = CUR_ATTACH->body->filename;
2423  int ret = mutt_buffer_get_field(_("Send attachment with name: "), &fname,
2424  MUTT_FILE, false, NULL, NULL, NULL);
2425  if (ret == 0)
2426  {
2427  /* As opposed to RENAME_FILE, we don't check buf[0] because it's
2428  * valid to set an empty string here, to erase what was set */
2429  mutt_str_replace(&CUR_ATTACH->body->d_filename, mutt_buffer_string(&fname));
2430  menu->redraw |= REDRAW_CURRENT;
2431  }
2432  break;
2433  }
2434 
2435  case OP_COMPOSE_RENAME_FILE:
2436  CHECK_COUNT;
2437  mutt_buffer_strcpy(&fname, CUR_ATTACH->body->filename);
2439  if ((mutt_buffer_get_field(_("Rename to: "), &fname, MUTT_FILE, false,
2440  NULL, NULL, NULL) == 0) &&
2441  !mutt_buffer_is_empty(&fname))
2442  {
2443  struct stat st;
2444  if (stat(CUR_ATTACH->body->filename, &st) == -1)
2445  {
2446  /* L10N: "stat" is a system call. Do "man 2 stat" for more information. */
2447  mutt_error(_("Can't stat %s: %s"), mutt_buffer_string(&fname), strerror(errno));
2448  break;
2449  }
2450 
2451  mutt_buffer_expand_path(&fname);
2452  if (mutt_file_rename(CUR_ATTACH->body->filename, mutt_buffer_string(&fname)))
2453  break;
2454 
2455  mutt_str_replace(&CUR_ATTACH->body->filename, mutt_buffer_string(&fname));
2456  menu->redraw |= REDRAW_CURRENT;
2457 
2458  if (CUR_ATTACH->body->stamp >= st.st_mtime)
2461  }
2462  break;
2463 
2464  case OP_COMPOSE_NEW_MIME:
2465  {
2466  mutt_buffer_reset(&fname);
2467  if ((mutt_buffer_get_field(_("New file: "), &fname, MUTT_FILE, false,
2468  NULL, NULL, NULL) != 0) ||
2469  mutt_buffer_is_empty(&fname))
2470  {
2471  continue;
2472  }
2473  mutt_buffer_expand_path(&fname);
2474 
2475  /* Call to lookup_mime_type () ? maybe later */
2476  char type[256] = { 0 };
2477  if ((mutt_get_field("Content-Type: ", type, sizeof(type),
2478  MUTT_COMP_NO_FLAGS, false, NULL, NULL) != 0) ||
2479  (type[0] == '\0'))
2480  {
2481  continue;
2482  }
2483 
2484  char *p = strchr(type, '/');
2485  if (!p)
2486  {
2487  mutt_error(_("Content-Type is of the form base/sub"));
2488  continue;
2489  }
2490  *p++ = 0;
2491  enum ContentType itype = mutt_check_mime_type(type);
2492  if (itype == TYPE_OTHER)
2493  {
2494  mutt_error(_("Unknown Content-Type %s"), type);
2495  continue;
2496  }
2497  struct AttachPtr *ap = mutt_mem_calloc(1, sizeof(struct AttachPtr));
2498  /* Touch the file */
2499  FILE *fp = mutt_file_fopen(mutt_buffer_string(&fname), "w");
2500  if (!fp)
2501  {
2502  mutt_error(_("Can't create file %s"), mutt_buffer_string(&fname));
2503  FREE(&ap);
2504  continue;
2505  }
2506  mutt_file_fclose(&fp);
2507 
2508  ap->body = mutt_make_file_attach(mutt_buffer_string(&fname), sub);
2509  if (!ap->body)
2510  {
2511  mutt_error(_("What we have here is a failure to make an attachment"));
2512  FREE(&ap);
2513  continue;
2514  }
2515  update_idx(menu, actx, ap);
2516 
2517  CUR_ATTACH->body->type = itype;
2518  mutt_str_replace(&CUR_ATTACH->body->subtype, p);
2519  CUR_ATTACH->body->unlink = true;
2520  menu->redraw |= REDRAW_INDEX | REDRAW_STATUS;
2521 
2523  {
2524  mutt_update_encoding(CUR_ATTACH->body, sub);
2525  menu->redraw = REDRAW_FULL;
2526  }
2528  break;
2529  }
2530 
2531  case OP_COMPOSE_EDIT_MIME:
2532  CHECK_COUNT;
2533  if (mutt_edit_attachment(CUR_ATTACH->body))
2534  {
2535  mutt_update_encoding(CUR_ATTACH->body, sub);
2536  menu->redraw = REDRAW_FULL;
2538  }
2539  break;
2540 
2541  case OP_VIEW_ATTACH:
2542  case OP_DISPLAY_HEADERS:
2543  CHECK_COUNT;
2544  mutt_attach_display_loop(menu, op, NULL, actx, false);
2545  menu->redraw = REDRAW_FULL;
2546  /* no send2hook, since this doesn't modify the message */
2547  break;
2548 
2549  case OP_SAVE:
2550  CHECK_COUNT;
2551  mutt_save_attachment_list(actx, NULL, menu->tagprefix, CUR_ATTACH->body, NULL, menu);
2552  /* no send2hook, since this doesn't modify the message */
2553  break;
2554 
2555  case OP_PRINT:
2556  CHECK_COUNT;
2557  mutt_print_attachment_list(actx, NULL, menu->tagprefix, CUR_ATTACH->body);
2558  /* no send2hook, since this doesn't modify the message */
2559  break;
2560 
2561  case OP_PIPE:
2562  case OP_FILTER:
2563  CHECK_COUNT;
2564  mutt_pipe_attachment_list(actx, NULL, menu->tagprefix, CUR_ATTACH->body,
2565  (op == OP_FILTER));
2566  if (op == OP_FILTER) /* cte might have changed */
2567  menu->redraw |= menu->tagprefix ? REDRAW_FULL : REDRAW_CURRENT;
2568  menu->redraw |= REDRAW_STATUS;
2570  break;
2571 
2572  case OP_EXIT:
2573  {
2574  const enum QuadOption c_postpone = cs_subset_quad(sub, "postpone");
2575  enum QuadOption ans =
2576  query_quadoption(c_postpone, _("Save (postpone) draft message?"));
2577  if (ans == MUTT_NO)
2578  {
2579  for (int i = 0; i < actx->idxlen; i++)
2580  if (actx->idx[i]->unowned)
2581  actx->idx[i]->body->unlink = false;
2582 
2583  if (!(flags & MUTT_COMPOSE_NOFREEHEADER))
2584  {
2585  for (int i = 0; i < actx->idxlen; i++)
2586  {
2587  /* avoid freeing other attachments */
2588  actx->idx[i]->body->next = NULL;
2589  /* See the comment in delete_attachment() */
2590  if (!actx->idx[i]->body->email)
2591  actx->idx[i]->body->parts = NULL;
2592  mutt_body_free(&actx->idx[i]->body);
2593  }
2594  }
2595  rc = -1;
2596  loop = false;
2597  break;
2598  }
2599  else if (ans == MUTT_ABORT)
2600  break; /* abort */
2601  }
2602  /* fallthrough */
2603 
2604  case OP_COMPOSE_POSTPONE_MESSAGE:
2605  if (check_attachments(actx, sub) != 0)
2606  {
2607  menu->redraw = REDRAW_FULL;
2608  break;
2609  }
2610 
2611  loop = false;
2612  rc = 1;
2613  break;
2614 
2615  case OP_COMPOSE_ISPELL:
2616  {
2617  endwin();
2618  const char *c_ispell = cs_subset_string(sub, "ispell");
2619  snprintf(buf, sizeof(buf), "%s -x %s", NONULL(c_ispell), e->body->filename);
2620  if (mutt_system(buf) == -1)
2621  mutt_error(_("Error running \"%s\""), buf);
2622  else
2623  {
2624  mutt_update_encoding(e->body, sub);
2625  menu->redraw |= REDRAW_STATUS;
2626  }
2627  break;
2628  }
2629 
2630  case OP_COMPOSE_WRITE_MESSAGE:
2631  mutt_buffer_reset(&fname);
2632  if (Context)
2633  {
2636  }
2637  if (actx->idxlen)
2638  e->body = actx->idx[0]->body;
2639  if ((mutt_buffer_enter_fname(_("Write message to mailbox"), &fname,
2640  true, ctx_mailbox(Context), false, NULL,
2641  NULL, MUTT_SEL_NO_FLAGS) != -1) &&
2642  !mutt_buffer_is_empty(&fname))
2643  {
2644  mutt_message(_("Writing message to %s ..."), mutt_buffer_string(&fname));
2645  mutt_buffer_expand_path(&fname);
2646 
2647  if (e->body->next)
2648  e->body = mutt_make_multipart(e->body);
2649 
2650  if (mutt_write_fcc(mutt_buffer_string(&fname), e, NULL, false, NULL, NULL, sub) == 0)
2651  mutt_message(_("Message written"));
2652 
2653  e->body = mutt_remove_multipart(e->body);
2654  }
2655  break;
2656 
2657  case OP_COMPOSE_PGP_MENU:
2658  {
2659  const SecurityFlags old_flags = e->security;
2660  if (!(WithCrypto & APPLICATION_PGP))
2661  break;
2663  {
2664  mutt_error(_("No PGP backend configured"));
2665  break;
2666  }
2667  if (((WithCrypto & APPLICATION_SMIME) != 0) && (e->security & APPLICATION_SMIME))
2668  {
2669  if (e->security & (SEC_ENCRYPT | SEC_SIGN))
2670  {
2671  if (mutt_yesorno(_("S/MIME already selected. Clear and continue?"), MUTT_YES) != MUTT_YES)
2672  {
2673  mutt_clear_error();
2674  break;
2675  }
2676  e->security &= ~(SEC_ENCRYPT | SEC_SIGN);
2677  }
2678  e->security &= ~APPLICATION_SMIME;
2679  e->security |= APPLICATION_PGP;
2680  update_crypt_info(rd);
2681  }
2682  e->security = crypt_pgp_send_menu(e);
2683  update_crypt_info(rd);
2684  if (old_flags != e->security)
2685  {
2687  redraw_env = true;
2688  }
2689  break;
2690  }
2691 
2692  case OP_FORGET_PASSPHRASE:
2694  break;
2695 
2696  case OP_COMPOSE_SMIME_MENU:
2697  {
2698  const SecurityFlags old_flags = e->security;
2699  if (!(WithCrypto & APPLICATION_SMIME))
2700  break;
2702  {
2703  mutt_error(_("No S/MIME backend configured"));
2704  break;
2705  }
2706 
2707  if (((WithCrypto & APPLICATION_PGP) != 0) && (e->security & APPLICATION_PGP))
2708  {
2709  if (e->security & (SEC_ENCRYPT | SEC_SIGN))
2710  {
2711  if (mutt_yesorno(_("PGP already selected. Clear and continue?"), MUTT_YES) != MUTT_YES)
2712  {
2713  mutt_clear_error();
2714  break;
2715  }
2716  e->security &= ~(SEC_ENCRYPT | SEC_SIGN);
2717  }
2718  e->security &= ~APPLICATION_PGP;
2720  update_crypt_info(rd);
2721  }
2723  update_crypt_info(rd);
2724  if (old_flags != e->security)
2725  {
2727  redraw_env = true;
2728  }
2729  break;
2730  }
2731 
2732 #ifdef MIXMASTER
2733  case OP_COMPOSE_MIX:
2735  rd->win_envelope->state.cols);
2737  redraw_env = true;
2738  break;
2739 #endif
2740 
2741 #ifdef USE_AUTOCRYPT
2742  case OP_COMPOSE_AUTOCRYPT_MENU:
2743  {
2744  const SecurityFlags old_flags = e->security;
2745  const bool c_autocrypt = cs_subset_bool(sub, "autocrypt");
2746  if (!c_autocrypt)
2747  break;
2748 
2750  {
2751  if (e->security & (SEC_ENCRYPT | SEC_SIGN))
2752  {
2753  if (mutt_yesorno(_("S/MIME already selected. Clear and continue?"), MUTT_YES) != MUTT_YES)
2754  {
2755  mutt_clear_error();
2756  break;
2757  }
2758  e->security &= ~(SEC_ENCRYPT | SEC_SIGN);
2759  }
2760  e->security &= ~APPLICATION_SMIME;
2761  e->security |= APPLICATION_PGP;
2762  update_crypt_info(rd);
2763  }
2764  autocrypt_compose_menu(e, sub);
2765  update_crypt_info(rd);
2766  if (old_flags != e->security)
2767  {
2769  redraw_env = true;
2770  }
2771  break;
2772  }
2773 #endif
2774  }
2775  }
2776 
2777  mutt_buffer_dealloc(&fname);
2778 
2779 #ifdef USE_AUTOCRYPT
2780  /* This is a fail-safe to make sure the bit isn't somehow turned
2781  * on. The user could have disabled the option after setting SEC_AUTOCRYPT,
2782  * or perhaps resuming or replying to an autocrypt message. */
2783  const bool c_autocrypt = cs_subset_bool(sub, "autocrypt");
2784  if (!c_autocrypt)
2785  e->security &= ~SEC_AUTOCRYPT;
2786 #endif
2787 
2788  mutt_menu_pop_current(menu);
2789  mutt_menu_free(&menu);
2790  dialog_pop();
2793  mutt_window_free(&dlg);
2794 
2795  if (actx->idxlen)
2796  e->body = actx->idx[0]->body;
2797  else
2798  e->body = NULL;
2799 
2800  mutt_actx_free(&actx);
2801 
2802  mutt_list_free(&redraw.to_list);
2803  mutt_list_free(&redraw.cc_list);
2804  mutt_list_free(&redraw.bcc_list);
2805  return rc;
2806 }
+ Here is the caller graph for this function:
ctx_free
void ctx_free(struct Context **ptr)
Free a Context.
Definition: context.c:50
Envelope::subject
char * subject
Email's subject.
Definition: envelope.h:66
AttachCtx
A set of attachments.
Definition: attach.h:49
ComposeNewsHelp
static const struct Mapping ComposeNewsHelp[]
Help Bar for the News Compose dialog.
Definition: compose.c:238
ComposeRedrawData::win_attach
struct MuttWindow * win_attach
List of Attachments.
Definition: compose.c:127
mutt_generate_boundary
void mutt_generate_boundary(struct ParameterList *pl)
Create a unique boundary id for a MIME part.
Definition: multipart.c:86
Envelope::bcc
struct AddressList bcc
Email's 'Bcc' list.
Definition: envelope.h:60
STAILQ_INIT
#define STAILQ_INIT(head)
Definition: queue.h:369
HDR_CC
@ HDR_CC
"Cc:" field
Definition: compose.c:151
CHECK_COUNT
#define CHECK_COUNT
Definition: compose.c:133
WT_CUSTOM
@ WT_CUSTOM
Window with a custom drawing function.
Definition: mutt_window.h:92
dialog_pop
void dialog_pop(void)
Hide a Window from the user.
Definition: dialog.c:98
crypt_pgp_make_key_attachment
struct Body * crypt_pgp_make_key_attachment(void)
Wrapper for CryptModuleSpecs::pgp_make_key_attachment()
Definition: cryptglue.c:305
snd_make_entry
static void snd_make_entry(struct Menu *menu, char *buf, size_t buflen, int line)
Format a menu item for the attachment list - Implements Menu::make_entry()
Definition: compose.c:333
mutt_message_hook
void mutt_message_hook(struct Mailbox *m, struct Email *e, HookFlags type)
Perform a message hook.
Definition: hook.c:574
MUTT_READONLY
#define MUTT_READONLY
Open in read-only mode.
Definition: mx.h:54
update_crypt_info
static void update_crypt_info(struct ComposeRedrawData *rd)
Update the crypto info.
Definition: compose.c:680
QuadOption
QuadOption
Possible values for a quad-option.
Definition: quad.h:36
Envelope::followup_to
char * followup_to
List of 'followup-to' fields.
Definition: envelope.h:77
ComposeRedrawData::win_abar
struct MuttWindow * win_abar
Attachments label.
Definition: compose.c:126
delete_attachment
static int delete_attachment(struct AttachCtx *actx, int x)
Delete an attachment.
Definition: compose.c:1073
attach_tag
int attach_tag(struct Menu *menu, int sel, int act)
Tag an attachment - Implements Menu::tag()
Definition: recvattach.c:458
mutt_actx_new
struct AttachCtx * mutt_actx_new(void)
Create a new Attachment Context.
Definition: attach.c:131
mutt_mem_calloc
void * mutt_mem_calloc(size_t nmemb, size_t size)
Allocate zeroed memory on the heap.
Definition: memory.c:50
mutt_stamp_attachment
void mutt_stamp_attachment(struct Body *a)
Timestamp an Attachment.
Definition: sendlib.c:893
_
#define _(a)
Definition: message.h:28
NONULL
#define NONULL(x)
Definition: string2.h:37
Mailbox
A mailbox.
Definition: mailbox.h:81
compose_custom_redraw
static void compose_custom_redraw(struct Menu *menu)
Redraw the compose menu - Implements Menu::custom_redraw()
Definition: compose.c:1202
mutt_actx_entries_free
void mutt_actx_entries_free(struct AttachCtx *actx)
Free entries in an Attachment Context.
Definition: attach.c:103
ENC_UUENCODED
@ ENC_UUENCODED
UUEncoded text.
Definition: mime.h:54
APPLICATION_SMIME
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
Definition: lib.h:98
MUTT_SEND2_HOOK
#define MUTT_SEND2_HOOK
send2-hook: when changing fields in the compose menu
Definition: hook.h:56
Mailbox::emails
struct Email ** emails
Array of Emails.
Definition: mailbox.h:99
mutt_system
int mutt_system(const char *cmd)
Run an external command.
Definition: system.c:51
ComposeRedrawData::to_list
struct ListHead to_list
Definition: compose.c:112
nntp_expand_path
void nntp_expand_path(char *buf, size_t buflen, struct ConnAccount *acct)
Make fully qualified url from newsgroup name.
Definition: newsrc.c:560
NT_CONFIG
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
Definition: notify_type.h:37
mutt_env_to_intl
int mutt_env_to_intl(struct Envelope *env, const char **tag, char **err)
Convert an Envelope's Address fields to Punycode format.
Definition: envelope.c:309
Buffer
String manipulation buffer.
Definition: buffer.h:33
HDR_FCC
@ HDR_FCC
"Fcc:" (save folder) field
Definition: compose.c:155
Connection::account
struct ConnAccount account
Account details: username, password, etc.
Definition: connection.h:36
ctx_mailbox
struct Mailbox * ctx_mailbox(struct Context *ctx)
wrapper to get the mailbox in a Context, or NULL
Definition: context.c:429
mutt_update_encoding
void mutt_update_encoding(struct Body *a, struct ConfigSubset *sub)
Update the encoding type.
Definition: sendlib.c:905
mutt_file_fclose
int mutt_file_fclose(FILE **fp)
Close a FILE handle (and NULL the pointer)
Definition: file.c:153
mutt_buffer_pretty_mailbox
void mutt_buffer_pretty_mailbox(struct Buffer *buf)
Shorten a mailbox path using '~' or '='.
Definition: muttlib.c:599
crypt_smime_send_menu
SecurityFlags crypt_smime_send_menu(struct Email *e)
Wrapper for CryptModuleSpecs::send_menu()
Definition: cryptglue.c:531
Body::next
struct Body * next
next attachment in the list
Definition: body.h:53
mutt_buffer_is_empty
bool mutt_buffer_is_empty(const struct Buffer *buf)
Is the Buffer empty?
Definition: buffer.c:252
index_pager_init
struct MuttWindow * index_pager_init(void)
Allocate the Windows for the Index/Pager.
Definition: index.c:4187
mutt_buffer_dealloc
void mutt_buffer_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
Definition: buffer.c:294
Body
The body of an email.
Definition: body.h:34
SEC_ENCRYPT
#define SEC_ENCRYPT
Email is encrypted.
Definition: lib.h:85
dialog_push
void dialog_push(struct MuttWindow *dlg)
Display a Window to the user.
Definition: dialog.c:66
mutt_check_encoding
int mutt_check_encoding(const char *c)
Check the encoding type.
Definition: parse.c:398
AttachPtr::fp
FILE * fp
Used in the recvattach menu.
Definition: attach.h:37
mutt_remove_multipart
struct Body * mutt_remove_multipart(struct Body *b)
Extract the multipart body if it exists.
Definition: multipart.c:126
ComposeRedrawData::email
struct Email * email
Definition: compose.c:109
SEC_SIGN
#define SEC_SIGN
Email is signed.
Definition: lib.h:86
MUTT_SEL_NO_FLAGS
#define MUTT_SEL_NO_FLAGS
No flags are set.
Definition: browser.h:41
CUR_ATTACH
#define CUR_ATTACH
Definition: compose.c:140
MUTT_POP
@ MUTT_POP
'POP3' Mailbox type
Definition: mailbox.h:55
NeoMutt::notify
struct Notify * notify
Notifications handler.
Definition: neomutt.h:38
message_is_tagged
bool message_is_tagged(struct Context *ctx, struct Email *e)
Is a message in the index tagged (and within limit)
Definition: context.c:335
AttachPtr
An email to which things will be attached.
Definition: attach.h:34
MuttWindow
A division of the screen.
Definition: mutt_window.h:115
cs_subset_bool
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:69
SortType
SortType
Methods for sorting.
Definition: sort2.h:43
crypt_has_module_backend
bool crypt_has_module_backend(SecurityFlags type)
Is there a crypto backend for a given type?
Definition: cryptglue.c:169
mutt_make_multipart
struct Body * mutt_make_multipart(struct Body *b)
Create a multipart email.
Definition: multipart.c:100
MUTT_YES
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
Definition: quad.h:40
Context
The "current" mailbox.
Definition: context.h:38
HDR_REPLYTO
@ HDR_REPLYTO
"Reply-To:" field
Definition: compose.c:154
mutt_str_dup
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:370
mutt_file_fopen
FILE * mutt_file_fopen(const char *path, const char *mode)
Call fopen() safely.
Definition: file.c:589
LL_DEBUG1
@ LL_DEBUG1
Log at debug level 1.
Definition: logging.h:40
Envelope::x_comment_to
char * x_comment_to
List of 'X-comment-to' fields.
Definition: envelope.h:78
mutt_check_mime_type
enum ContentType mutt_check_mime_type(const char *s)
Check a MIME type string.
Definition: parse.c:325
ComposeRedrawData::win_envelope
struct MuttWindow * win_envelope
Envelope: From, To, etc.
Definition: compose.c:125
mix_check_message
int mix_check_message(struct Email *e)
Safety-check the message before passing it to mixmaster.
Definition: remailer.c:794
FREE
#define FREE(x)
Definition: memory.h:40
Body::disposition
unsigned int disposition
content-disposition, ContentDisposition
Definition: body.h:67
mutt_perror
#define mutt_perror(...)
Definition: logging.h:85
ContentType
ContentType
Content-Type.
Definition: mime.h:29
mutt_menu_new
struct Menu * mutt_menu_new(enum MenuType type)
Create a new Menu.
Definition: menu.c:956
Buffer::dsize
size_t dsize
Length of data.
Definition: buffer.h:37
DISP_ATTACH
@ DISP_ATTACH
Content is attached.
Definition: mime.h:63
MuttWindow::help_menu
int help_menu
Menu for key bindings, e.g. MENU_PAGER.
Definition: mutt_window.h:134
SecurityFlags
uint16_t SecurityFlags
Flags, e.g. SEC_ENCRYPT.
Definition: lib.h:83
HDR_TO
@ HDR_TO
"To:" field
Definition: compose.c:150
PATH_MAX
#define PATH_MAX
Definition: mutt.h:44
HDR_ATTACH_TITLE
@ HDR_ATTACH_TITLE
The "-- Attachments" line.
Definition: compose.c:170
MUTT_ABORT
@ MUTT_ABORT
User aborted the question (with Ctrl-G)
Definition: quad.h:38
Menu::make_entry
void(* make_entry)(struct Menu *menu, char *buf, size_t buflen, int line)
Format a item for a menu.
Definition: mutt_menu.h:88
mutt_buffer_reset
void mutt_buffer_reset(struct Buffer *buf)
Reset an existing Buffer.
Definition: buffer.c:79
STAILQ_EMPTY
#define STAILQ_EMPTY(head)
Definition: queue.h:345
Body::tagged
bool tagged
This attachment is tagged.
Definition: body.h:70
mx_path_probe
enum MailboxType mx_path_probe(const char *path)
Find a mailbox that understands a path.
Definition: mx.c:1335
MUTT_WIN_SIZE_MAXIMISE
@ MUTT_WIN_SIZE_MAXIMISE
Window wants as much space as possible.
Definition: mutt_window.h:45
Context
WHERE struct Context * Context
Definition: mutt_globals.h:42
mutt_body_free
void mutt_body_free(struct Body **ptr)
Free a Body.
Definition: body.c:57
Menu::win_ibar
struct MuttWindow * win_ibar
Definition: mutt_menu.h:64
Body::subtype
char * subtype
content-type subtype
Definition: body.h:37
mx_path_resolve
struct Mailbox * mx_path_resolve(const char *path)
Get a Mailbox for a path.
Definition: mx.c:1681
WT_DLG_COMPOSE
@ WT_DLG_COMPOSE
Compose Dialog, mutt_compose_menu()
Definition: mutt_window.h:79
mutt_write_fcc
int mutt_write_fcc(const char *path, struct Email *e, const char *msgid, bool post, const char *fcc, char **finalpath, struct ConfigSubset *sub)
Write email to FCC mailbox.
Definition: sendlib.c:1510
cs_subset_str_native_set
int cs_subset_str_native_set(const struct ConfigSubset *sub, const char *name, intptr_t value, struct Buffer *err)
Natively set the value of a string config item.
Definition: subset.c:292
check_attachments
static int check_attachments(struct AttachCtx *actx, struct ConfigSubset *sub)
Check if any attachments have changed or been deleted.
Definition: compose.c:765
NntpAccountData::conn
struct Connection * conn
Definition: adata.h:60
ComposeRedrawData::bcc_list
struct ListHead bcc_list
Definition: compose.c:114
mutt_edit_headers
void mutt_edit_headers(const char *editor, const char *body, struct Email *e, struct Buffer *fcc)
Let the user edit the message header and body.
Definition: mutt_header.c:170
mutt_str_equal
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:871
autocrypt_compose_menu
static void autocrypt_compose_menu(struct Email *e, const struct ConfigSubset *sub)
Autocrypt compose settings.
Definition: compose.c:352
Envelope::reply_to
struct AddressList reply_to
Email's 'reply-to'.
Definition: envelope.h:62
Menu::redraw_data
void * redraw_data
Definition: mutt_menu.h:124
MUTT_FILE
#define MUTT_FILE
Do file completion.
Definition: mutt.h:58
calc_envelope
static int calc_envelope(struct ComposeRedrawData *rd)
Calculate how many rows the envelope will need.
Definition: compose.c:528
Envelope::cc
struct AddressList cc
Email's 'Cc' list.
Definition: envelope.h:59
query_quadoption
enum QuadOption query_quadoption(enum QuadOption opt, const char *prompt)
Ask the user a quad-question.
Definition: curs_lib.c:518
HDR_XCOMMENTTO
@ HDR_XCOMMENTTO
"X-Comment-To:" field
Definition: compose.c:167
mutt_menu_push_current
void mutt_menu_push_current(struct Menu *menu)
Add a new Menu to the stack.
Definition: menu.c:1015
mutt_body_new
struct Body * mutt_body_new(void)
Create a new Body.
Definition: body.c:43
mutt_path_basename
const char * mutt_path_basename(const char *f)
Find the last component for a pathname.
Definition: path.c:329
MUTT_NNTP
@ MUTT_NNTP
'NNTP' (Usenet) Mailbox type
Definition: mailbox.h:52
nntp_path_probe
enum MailboxType nntp_path_probe(const char *path, const struct stat *st)
Is this an NNTP Mailbox? - Implements MxOps::path_probe()
Definition: nntp.c:2685
NT_HEADER
@ NT_HEADER
A header has changed, NotifyHeader EventHeader.
Definition: notify_type.h:41
mutt_edit_file
void mutt_edit_file(const char *editor, const char *file)
Let the user edit a file.
Definition: curs_lib.c:356
HDR_SUBJECT
@ HDR_SUBJECT
"Subject:" field
Definition: compose.c:153
Mailbox::type
enum MailboxType type
Mailbox type.
Definition: mailbox.h:105
mutt_edit_content_type
bool mutt_edit_content_type(struct Email *e, struct Body *b, FILE *fp)
Edit the content type of an attachment.
Definition: commands.c:1324
HDR_FROM
@ HDR_FROM
"From:" field
Definition: compose.c:149
mutt_buffer_copy
size_t mutt_buffer_copy(struct Buffer *dst, const struct Buffer *src)
Copy a Buffer's contents to another Buffer.
Definition: buffer.c:445
MUTT_WIN_ORIENT_VERTICAL
@ MUTT_WIN_ORIENT_VERTICAL
Window uses all available vertical space.
Definition: mutt_window.h:35
mutt_make_file_attach
struct Body * mutt_make_file_attach(const char *path, struct ConfigSubset *sub)
Create a file attachment.
Definition: sendlib.c:1083
mutt_pipe_attachment_list
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:1011
mx_mbox_close
enum MxStatus mx_mbox_close(struct Context **ptr)
Save changes and close mailbox.
Definition: mx.c:632
notify_observer_remove
bool notify_observer_remove(struct Notify *notify, observer_t callback, void *global_data)
Remove an observer from an object.
Definition: notify.c:207
OptAttachMsg
WHERE bool OptAttachMsg
(pseudo) used by attach-message
Definition: options.h:31
MENU_COMPOSE
@ MENU_COMPOSE
Compose an email.
Definition: keymap.h:76
OpStrings
const char * OpStrings[][2]
Definition: opcodes.c:28
APPLICATION_PGP
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition: lib.h:97
mutt_rfc3676_space_unstuff
void mutt_rfc3676_space_unstuff(struct Email *e)
Remove RFC3676 space stuffing.
Definition: rfc3676.c:492
REDRAW_FULL
#define REDRAW_FULL
Redraw everything.
Definition: mutt_menu.h:45
ComposeRedrawData::cc_list
struct ListHead cc_list
Definition: compose.c:113
compose_attach_swap
static void compose_attach_swap(struct Body *msg, struct AttachPtr **idx, short first)
Swap two adjacent entries in the attachment list.
Definition: compose.c:1251
Mailbox::msg_count
int msg_count
Total number of messages.
Definition: mailbox.h:91
mutt_compose_attachment
int mutt_compose_attachment(struct Body *a)
Create an attachment.
Definition: mutt_attach.c:119
mutt_make_message_attach
struct Body * mutt_make_message_attach(struct Mailbox *m, struct Email *e, bool attach_msg, struct ConfigSubset *sub)
Create a message attachment.
Definition: sendlib.c:937
mutt_clear_error
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
Definition: mutt_logging.c:113
mutt_env_to_local
void mutt_env_to_local(struct Envelope *env)
Convert an Envelope's Address fields to local format.
Definition: envelope.c:271
MUTT_SEL_MULTI
#define MUTT_SEL_MULTI
Multi-selection is enabled.
Definition: browser.h:43
mutt_window_new
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:166
Body::description
char * description
content-description
Definition: body.h:40
Menu::pagelen
int pagelen
Number of entries per screen.
Definition: mutt_menu.h:60
Menu::tagprefix
bool tagprefix
Definition: mutt_menu.h:61
ComposeRedrawData::win_cbar
struct MuttWindow * win_cbar
Compose bar.
Definition: compose.c:128
MUTT_NOTMUCH
@ MUTT_NOTMUCH
'Notmuch' (virtual) Mailbox type
Definition: mailbox.h:54
MUTT_IMAP
@ MUTT_IMAP
'IMAP' Mailbox type
Definition: mailbox.h:53
HDR_FOLLOWUPTO
@ HDR_FOLLOWUPTO
"Followup-To:" field
Definition: compose.c:166
Envelope::to
struct AddressList to
Email's 'To' list.
Definition: envelope.h:58
Body::parts
struct Body * parts
parts of a multipart or message/rfc822
Definition: body.h:54
AttachPtr::body
struct Body * body
Attachment.
Definition: attach.h:36
Context::mailbox
struct Mailbox * mailbox
Definition: context.h:50
update_idx
static void update_idx(struct Menu *menu, struct AttachCtx *actx, struct AttachPtr *ap)
Add a new attchment to the message.
Definition: compose.c:1188
Email::env
struct Envelope * env
Envelope information.
Definition: email.h:90
compose_config_observer
static int compose_config_observer(struct NotifyCallback *nc)
Listen for config changes affecting the Compose menu - Implements observer_t.
Definition: compose.c:1401
mutt_debug
#define mutt_debug(LEVEL,...)
Definition: logging.h:81
MUTT_WIN_SIZE_UNLIMITED
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
Definition: mutt_window.h:49
MUTT_NO
@ MUTT_NO
User answered 'No', or assume 'No'.
Definition: quad.h:39
Menu::tag
int(* tag)(struct Menu *menu, int sel, int act)
Tag some menu items.
Definition: mutt_menu.h:107
notify_observer_add
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
Definition: notify.c:169
mutt_buffer_expand_path
void mutt_buffer_expand_path(struct Buffer *buf)
Create the canonical path.
Definition: muttlib.c:323
REDRAW_INDEX
#define REDRAW_INDEX
Redraw the index.
Definition: mutt_menu.h:40
nntp_select_server
struct NntpAccountData * nntp_select_server(struct Mailbox *m, const char *server, bool leave_lock)
Open a connection to an NNTP server.
Definition: newsrc.c:1012
mutt_buffer_get_field
int mutt_buffer_get_field(const char *field, struct Buffer *buf, CompletionFlags complete, bool multiple, struct Mailbox *m, char ***files, int *numfiles)
Ask the user for a string.
Definition: curs_lib.c:260
mutt_buffer_string
static const char * mutt_buffer_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:77
CurrentNewsSrv
struct NntpAccountData * CurrentNewsSrv
Current NNTP news server.
Definition: nntp.c:79
WindowState::rows
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:58
Email::chain
struct ListHead chain
Mixmaster chain.
Definition: email.h:102
Email::security
SecurityFlags security
bit 0-10: flags, bit 11,12: application, bit 13: traditional pgp See: ncrypt/lib.h pgplib....
Definition: email.h:39
pop_path_probe
enum MailboxType pop_path_probe(const char *path, const struct stat *st)
Is this a POP Mailbox? - Implements MxOps::path_probe()
Definition: pop.c:1149
cs_subset_quad
enum QuadOption cs_subset_quad(const struct ConfigSubset *sub, const char *name)
Get a quad-value config item by name.
Definition: helpers.c:154
MuttWindow::help_data
const struct Mapping * help_data
Data for the Help Bar.
Definition: mutt_window.h:135
mutt_str_replace
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Definition: string.c:446
cs_subset_sort
short cs_subset_sort(const struct ConfigSubset *sub, const char *name)
Get a sort config item by name.
Definition: helpers.c:219
WithCrypto
#define WithCrypto
Definition: lib.h:123
mutt_menu_loop
int mutt_menu_loop(struct Menu *menu)
Menu event loop.
Definition: menu.c:1309
MuttWindow::state
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:120
Envelope::newsgroups
char * newsgroups
List of newsgroups.
Definition: envelope.h:75
mutt_edit_attachment
int mutt_edit_attachment(struct Body *a)
Edit an attachment.
Definition: mutt_attach.c:259
ComposeHelp
static const struct Mapping ComposeHelp[]
Help Bar for the Compose dialog.
Definition: compose.c:219
mutt_menu_pop_current
void mutt_menu_pop_current(struct Menu *menu)
Remove a Menu from the stack.
Definition: menu.c:1027
WT_INDEX
@ WT_INDEX
An Index Window containing a selection list.
Definition: mutt_window.h:94
ComposeRedrawData
Keep track when the compose screen needs redrawing.
Definition: compose.c:107
crypt_forget_passphrase
void crypt_forget_passphrase(void)
Forget a passphrase and display a message.
Definition: crypt.c:93
MuttWindow::req_rows
short req_rows
Number of rows required.
Definition: mutt_window.h:118
cs_subset_string
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:241
ENCODING
#define ENCODING(x)
Definition: mime.h:92
Mailbox::readonly
bool readonly
Don't allow changes to the mailbox.
Definition: mailbox.h:119
ALTS_TAG
#define ALTS_TAG
Envelope::from
struct AddressList from
Email's 'From' list.
Definition: envelope.h:57
HDR_NEWSGROUPS
@ HDR_NEWSGROUPS
"Newsgroups:" field
Definition: compose.c:165
init_header_padding
static void init_header_padding(void)
Calculate how much padding the compose table will need.
Definition: compose.c:302
Menu::tagged
int tagged
Number of tagged entries.
Definition: mutt_menu.h:78
Menu::custom_redraw
void(* custom_redraw)(struct Menu *menu)
Redraw the menu.
Definition: mutt_menu.h:122
WT_INDEX_BAR
@ WT_INDEX_BAR
Index Bar containing status info about the Index.
Definition: mutt_window.h:95
ComposeRedrawData::sub
struct ConfigSubset * sub
Inherited config items.
Definition: compose.c:130
ComposeRedrawData::fcc
struct Buffer * fcc
Definition: compose.c:110
edit_address_list
static bool edit_address_list(int field, struct AddressList *al)
Let the user edit the address list.
Definition: compose.c:1040
MUTT_COMPOSE_NOFREEHEADER
#define MUTT_COMPOSE_NOFREEHEADER
Definition: lib.h:43
NeoMutt
Container for Accounts, Notifications.
Definition: neomutt.h:36
DISP_INLINE
@ DISP_INLINE
Content is inline.
Definition: mime.h:62
LINGUAL_TAG
#define LINGUAL_TAG
AttachCtx::email
struct Email * email
Used by recvattach for updating.
Definition: attach.h:51
Body::type
unsigned int type
content-type primary type, ContentType
Definition: body.h:65
ENC_OTHER
@ ENC_OTHER
Encoding unknown.
Definition: mime.h:48
mx_mbox_open
struct Context * mx_mbox_open(struct Mailbox *m, OpenMailboxFlags flags)
Open a mailbox and parse it.
Definition: mx.c:309
TYPE_OTHER
@ TYPE_OTHER
Unknown Content-Type.
Definition: mime.h:31
mutt_file_rename
int mutt_file_rename(const char *oldfile, const char *newfile)
Rename a file.
Definition: file.c:1347
mutt_attach_display_loop
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:1285
Menu::redraw
MuttRedrawFlags redraw
When to redraw the screen.
Definition: mutt_menu.h:58
imap_path_probe
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox? - Implements MxOps::path_probe()
Definition: imap.c:2372
mutt_actx_free
void mutt_actx_free(struct AttachCtx **ptr)
Free an Attachment Context.
Definition: attach.c:140
compose_header_observer
static int compose_header_observer(struct NotifyCallback *nc)
Listen for header changes - Implements observer_t.
Definition: compose.c:1433
mutt_update_compose_menu
static void mutt_update_compose_menu(struct AttachCtx *actx, struct Menu *menu, bool init)
Redraw the compose window.
Definition: compose.c:1159
REDRAW_CURRENT
#define REDRAW_CURRENT
Redraw the current line of the menu.
Definition: mutt_menu.h:43
MUTT_WIN_SIZE_FIXED
@ MUTT_WIN_SIZE_FIXED
Window has a fixed size.
Definition: mutt_window.h:44
MUTT_CLEAR
#define MUTT_CLEAR
Clear input if printable character is pressed.
Definition: mutt.h:62
AttachCtx::idx
struct AttachPtr ** idx
Array of attachments.
Definition: attach.h:54
Prompts
static const char *const Prompts[]
Definition: compose.c:176
mutt_get_tmp_attachment
int mutt_get_tmp_attachment(struct Body *a)
Get a temporary copy of an attachment.
Definition: mutt_attach.c:69
mutt_is_text_part
bool mutt_is_text_part(struct Body *b)
Is this part of an email in plain text?
Definition: muttlib.c:433
OptNewsSend
WHERE bool OptNewsSend
(pseudo) used to change behavior when posting
Definition: options.h:46
mutt_get_field
int mutt_get_field(const char *field, char *buf, size_t buflen, CompletionFlags complete, bool multiple, char ***files, int *numfiles)
Ask the user for a string.
Definition: curs_lib.c:311
Body::email
struct Email * email
header information for message/rfc822
Definition: body.h:55
mutt_rfc3676_space_stuff
void mutt_rfc3676_space_stuff(struct Email *e)
Perform RFC3676 space stuffing on an Email.
Definition: rfc3676.c:479
WindowState::cols
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:57
Body::unlink
bool unlink
If true, filename should be unlink()ed before free()ing this structure.
Definition: body.h:69
mailbox_path
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
Definition: mailbox.h:206
mutt_buffer_enter_fname
int mutt_buffer_enter_fname(const char *prompt, struct Buffer *fname, bool mailbox, struct Mailbox *m, bool multiple, char ***files, int *numfiles, SelectFileFlags flags)
Ask the user to select a file.
Definition: curs_lib.c:772
Menu::current
int current
Current entry.
Definition: mutt_menu.h:56
mx_fastclose_mailbox
void mx_fastclose_mailbox(struct Mailbox *m)
free up memory associated with the Mailbox
Definition: mx.c:451
mutt_window_add_child
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
Definition: mutt_window.c:565
Body::parameter
struct ParameterList parameter
parameters of the content-type
Definition: body.h:39
mutt_yesorno
enum QuadOption mutt_yesorno(const char *msg, enum QuadOption def)
Ask the user a Yes/No question.
Definition: curs_lib.c:380
Buffer::data
char * data
Pointer to data.
Definition: buffer.h:35
TYPE_MULTIPART
@ TYPE_MULTIPART
Type: 'multipart/*'.
Definition: mime.h:37
mutt_save_attachment_list
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:724
mutt_message
#define mutt_message(...)
Definition: logging.h:83
mutt_print_attachment_list
void mutt_print_attachment_list(struct AttachCtx *actx, FILE *fp, bool tag, struct Body *top)
Print a list of Attachments.
Definition: recvattach.c:1166
Menu::win_index
struct MuttWindow * win_index
Definition: mutt_menu.h:63
mutt_warning
#define mutt_warning(...)
Definition: logging.h:82
mutt_buffer_make
struct Buffer mutt_buffer_make(size_t size)
Make a new buffer on the stack.
Definition: buffer.c:61
mutt_list_free
void mutt_list_free(struct ListHead *h)
Free a List AND its strings.
Definition: list.c:122
Menu
GUI selectable list of items.
Definition: mutt_menu.h:52
AttachPtr::unowned
bool unowned
Don't unlink on detach.
Definition: attach.h:42
dlg_select_mixmaster_chain
void dlg_select_mixmaster_chain(struct MuttWindow *win, struct ListHead *chainhead, int cols)
Create a Mixmaster chain.
Definition: remailer.c:574
mutt_buffer_strcpy
size_t mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition: buffer.c:312
index_pager_shutdown
void index_pager_shutdown(struct MuttWindow *dlg)
Clear up any non-Window parts.
Definition: index.c:4205
HDR_BCC
@ HDR_BCC
"Bcc:" field
Definition: compose.c:152
REDRAW_STATUS
#define REDRAW_STATUS
Redraw the status bar.
Definition: mutt_menu.h:44
AttachCtx::idxlen
short idxlen
Number of attachmentes.
Definition: attach.h:55
SEC_AUTOCRYPT
#define SEC_AUTOCRYPT
(Autocrypt) Message will be, or was Autocrypt encrypt+signed
Definition: lib.h:94
crypt_pgp_send_menu
SecurityFlags crypt_pgp_send_menu(struct Email *e)
Wrapper for CryptModuleSpecs::send_menu()
Definition: cryptglue.c:385
Body::filename
char * filename
when sending a message, this is the file to which this structure refers
Definition: body.h:46
Email::body
struct Body * body
List of MIME parts.
Definition: email.h:91
mutt_index_menu
int mutt_index_menu(struct MuttWindow *dlg)
Display a list of emails.
Definition: index.c:1160
OptNews
WHERE bool OptNews
(pseudo) used to change reader mode
Definition: options.h:45
mutt_menu_free
void mutt_menu_free(struct Menu **ptr)
Destroy a menu.
Definition: menu.c:972
mutt_window_free
void mutt_window_free(struct MuttWindow **ptr)
Free a Window and its children.
Definition: mutt_window.c:186
mutt_error
#define mutt_error(...)
Definition: logging.h:84
mutt_window_reflow
void mutt_window_reflow(struct MuttWindow *win)
Resize a Window and its children.
Definition: mutt_window.c:433
mutt_str_copy
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition: string.c:716
MUTT_COMP_NO_FLAGS
#define MUTT_COMP_NO_FLAGS
No flags are set.
Definition: mutt.h:56