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

Go to the source code of this file.

Functions

int mutt_body_handler (struct Body *b, struct State *s)
 Handler for the Body of an email. More...
 
bool mutt_can_decode (struct Body *a)
 Will decoding the attachment produce any output. More...
 
void mutt_decode_attachment (struct Body *b, struct State *s)
 Decode an email's attachment. More...
 
void mutt_decode_base64 (struct State *s, size_t len, bool istext, iconv_t cd)
 Decode base64-encoded text. More...
 

Variables

bool C_HonorDisposition
 Config: Don't display MIME parts inline if they have a disposition of 'attachment'. More...
 
bool C_ImplicitAutoview
 Config: Display MIME attachments inline if a 'copiousoutput' mailcap entry exists. More...
 
bool C_IncludeEncrypted
 Config: Whether to include encrypted content when replying. More...
 
bool C_IncludeOnlyFirst
 Config: Only include the first attachment when replying. More...
 
struct SlistC_PreferredLanguages
 Config: Preferred languages for multilingual MIME. More...
 
bool C_ReflowText
 Config: Reformat paragraphs of 'format=flowed' text. More...
 
char * C_ShowMultipartAlternative
 Config: How to display 'multipart/alternative' MIME parts. More...
 

Detailed Description

Decide how to display email content

Authors
  • Michael R. Elkins

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

Function Documentation

◆ mutt_body_handler()

int mutt_body_handler ( struct Body b,
struct State s 
)

Handler for the Body of an email.

Parameters
bBody of the email
sState to work with
Return values
0Success
-1Error

Definition at line 1595 of file handler.c.

1596 {
1597  if (!b || !s)
1598  return -1;
1599 
1600  bool plaintext = false;
1601  handler_t handler = NULL;
1602  handler_t encrypted_handler = NULL;
1603  int rc = 0;
1604  static unsigned short recurse_level = 0;
1605 
1606  int oflags = s->flags;
1607 
1608  if (recurse_level >= MUTT_MIME_MAX_DEPTH)
1609  {
1610  mutt_debug(LL_DEBUG1, "recurse level too deep. giving up.\n");
1611  return 1;
1612  }
1613  recurse_level++;
1614 
1615  /* first determine which handler to use to process this part */
1616 
1617  if (is_autoview(b))
1618  {
1619  handler = autoview_handler;
1620  s->flags &= ~MUTT_CHARCONV;
1621  }
1622  else if (b->type == TYPE_TEXT)
1623  {
1624  if (mutt_istr_equal("plain", b->subtype))
1625  {
1626  /* avoid copying this part twice since removing the transfer-encoding is
1627  * the only operation needed. */
1628  if (((WithCrypto & APPLICATION_PGP) != 0) && mutt_is_application_pgp(b))
1629  {
1630  encrypted_handler = crypt_pgp_application_handler;
1631  handler = encrypted_handler;
1632  }
1633  else if (C_ReflowText && mutt_istr_equal("flowed", mutt_param_get(&b->parameter, "format")))
1634  {
1635  handler = rfc3676_handler;
1636  }
1637  else
1638  {
1639  handler = text_plain_handler;
1640  }
1641  }
1642  else if (mutt_istr_equal("enriched", b->subtype))
1643  handler = text_enriched_handler;
1644  else /* text body type without a handler */
1645  plaintext = false;
1646  }
1647  else if (b->type == TYPE_MESSAGE)
1648  {
1649  if (mutt_is_message_type(b->type, b->subtype))
1650  handler = message_handler;
1651  else if (mutt_istr_equal("delivery-status", b->subtype))
1652  plaintext = true;
1653  else if (mutt_istr_equal("external-body", b->subtype))
1654  handler = external_body_handler;
1655  }
1656  else if (b->type == TYPE_MULTIPART)
1657  {
1658  if (!mutt_str_equal("inline", C_ShowMultipartAlternative) &&
1659  mutt_istr_equal("alternative", b->subtype))
1660  {
1661  handler = alternative_handler;
1662  }
1663  else if (!mutt_str_equal("inline", C_ShowMultipartAlternative) &&
1664  mutt_istr_equal("multilingual", b->subtype))
1665  {
1666  handler = multilingual_handler;
1667  }
1668  else if ((WithCrypto != 0) && mutt_istr_equal("signed", b->subtype))
1669  {
1670  if (!mutt_param_get(&b->parameter, "protocol"))
1671  mutt_error(_("Error: multipart/signed has no protocol"));
1672  else if (s->flags & MUTT_VERIFY)
1673  handler = mutt_signed_handler;
1674  }
1676  {
1677  encrypted_handler = valid_pgp_encrypted_handler;
1678  handler = encrypted_handler;
1679  }
1681  {
1682  encrypted_handler = malformed_pgp_encrypted_handler;
1683  handler = encrypted_handler;
1684  }
1685 
1686  if (!handler)
1687  handler = multipart_handler;
1688 
1689  if ((b->encoding != ENC_7BIT) && (b->encoding != ENC_8BIT) && (b->encoding != ENC_BINARY))
1690  {
1691  mutt_debug(LL_DEBUG1, "Bad encoding type %d for multipart entity, assuming 7 bit\n",
1692  b->encoding);
1693  b->encoding = ENC_7BIT;
1694  }
1695  }
1696  else if ((WithCrypto != 0) && (b->type == TYPE_APPLICATION))
1697  {
1698  if (OptDontHandlePgpKeys && mutt_istr_equal("pgp-keys", b->subtype))
1699  {
1700  /* pass raw part through for key extraction */
1701  plaintext = true;
1702  }
1703  else if (((WithCrypto & APPLICATION_PGP) != 0) && mutt_is_application_pgp(b))
1704  {
1705  encrypted_handler = crypt_pgp_application_handler;
1706  handler = encrypted_handler;
1707  }
1708  else if (((WithCrypto & APPLICATION_SMIME) != 0) && mutt_is_application_smime(b))
1709  {
1710  encrypted_handler = crypt_smime_application_handler;
1711  handler = encrypted_handler;
1712  }
1713  }
1714 
1715  /* only respect disposition == attachment if we're not
1716  * displaying from the attachment menu (i.e. pager) */
1717  if ((!C_HonorDisposition || ((b->disposition != DISP_ATTACH) || OptViewAttach)) &&
1718  (plaintext || handler))
1719  {
1720  /* Prevent encrypted attachments from being included in replies
1721  * unless $include_encrypted is set. */
1722  if ((s->flags & MUTT_REPLYING) && (s->flags & MUTT_FIRSTDONE) &&
1723  encrypted_handler && !C_IncludeEncrypted)
1724  {
1725  goto cleanup;
1726  }
1727 
1728  rc = run_decode_and_handler(b, s, handler, plaintext);
1729  }
1730  /* print hint to use attachment menu for disposition == attachment
1731  * if we're not already being called from there */
1732  else if (s->flags & MUTT_DISPLAY)
1733  {
1734  struct Buffer msg = mutt_buffer_make(256);
1735 
1736  if (!OptViewAttach)
1737  {
1738  char keystroke[128] = { 0 };
1739  if (km_expand_key(keystroke, sizeof(keystroke),
1740  km_find_func(MENU_PAGER, OP_VIEW_ATTACHMENTS)))
1741  {
1743  {
1744  /* L10N: %s expands to a keystroke/key binding, e.g. 'v'. */
1745  mutt_buffer_printf(&msg, _("[-- This is an attachment (use '%s' to view this part) --]\n"),
1746  keystroke);
1747  }
1748  else
1749  {
1750  /* L10N: %s/%s is a MIME type, e.g. "text/plain".
1751  The last %s expands to a keystroke/key binding, e.g. 'v'. */
1752  mutt_buffer_printf(&msg, _("[-- %s/%s is unsupported (use '%s' to view this part) --]\n"),
1753  TYPE(b), b->subtype, keystroke);
1754  }
1755  }
1756  else
1757  {
1759  {
1760  mutt_buffer_strcpy(&msg, _("[-- This is an attachment (need "
1761  "'view-attachments' bound to key) --]\n"));
1762  }
1763  else
1764  {
1765  /* L10N: %s/%s is a MIME type, e.g. "text/plain". */
1766  mutt_buffer_printf(&msg, _("[-- %s/%s is unsupported (need 'view-attachments' bound to key) --]\n"),
1767  TYPE(b), b->subtype);
1768  }
1769  }
1770  }
1771  else
1772  {
1774  {
1775  mutt_buffer_strcpy(&msg, _("[-- This is an attachment --]\n"));
1776  }
1777  else
1778  {
1779  /* L10N: %s/%s is a MIME type, e.g. "text/plain". */
1780  mutt_buffer_printf(&msg, _("[-- %s/%s is unsupported --]\n"), TYPE(b), b->subtype);
1781  }
1782  }
1783  state_mark_attach(s);
1784  state_printf(s, "%s", mutt_buffer_string(&msg));
1785  mutt_buffer_dealloc(&msg);
1786  }
1787 
1788 cleanup:
1789  recurse_level--;
1790  s->flags = oflags | (s->flags & MUTT_FIRSTDONE);
1791  if (rc != 0)
1792  {
1793  mutt_debug(LL_DEBUG1, "Bailing on attachment of type %s/%s\n", TYPE(b),
1794  NONULL(b->subtype));
1795  }
1796 
1797  return rc;
1798 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_can_decode()

bool mutt_can_decode ( struct Body a)

Will decoding the attachment produce any output.

Parameters
aBody of email to test
Return values
trueDecoding the attachment will produce output

Definition at line 1805 of file handler.c.

1806 {
1807  if (is_autoview(a))
1808  return true;
1809  if (a->type == TYPE_TEXT)
1810  return true;
1811  if (a->type == TYPE_MESSAGE)
1812  return true;
1813  if (a->type == TYPE_MULTIPART)
1814  {
1815  if (WithCrypto)
1816  {
1817  if (mutt_istr_equal(a->subtype, "signed") || mutt_istr_equal(a->subtype, "encrypted"))
1818  {
1819  return true;
1820  }
1821  }
1822 
1823  for (struct Body *b = a->parts; b; b = b->next)
1824  {
1825  if (mutt_can_decode(b))
1826  return true;
1827  }
1828  }
1829  else if ((WithCrypto != 0) && (a->type == TYPE_APPLICATION))
1830  {
1831  if (((WithCrypto & APPLICATION_PGP) != 0) && mutt_is_application_pgp(a))
1832  return true;
1834  return true;
1835  }
1836 
1837  return false;
1838 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_decode_attachment()

void mutt_decode_attachment ( struct Body b,
struct State s 
)

Decode an email's attachment.

Parameters
bBody of the email
sState of text being processed

Definition at line 1845 of file handler.c.

1846 {
1847  int istext = mutt_is_text_part(b) && (b->disposition == DISP_INLINE);
1848  iconv_t cd = (iconv_t)(-1);
1849 
1850  if (istext && (b->charset || (s->flags & MUTT_CHARCONV)))
1851  {
1852  const char *charset = b->charset;
1853  if (!charset)
1854  {
1855  charset = mutt_param_get(&b->parameter, "charset");
1856  if (!charset && C_AssumedCharset)
1857  charset = mutt_ch_get_default_charset();
1858  }
1859  if (charset && C_Charset)
1861  }
1862 
1863  fseeko(s->fp_in, b->offset, SEEK_SET);
1864  switch (b->encoding)
1865  {
1866  case ENC_QUOTED_PRINTABLE:
1867  decode_quoted(s, b->length,
1868  istext || (((WithCrypto & APPLICATION_PGP) != 0) &&
1870  cd);
1871  break;
1872  case ENC_BASE64:
1873  mutt_decode_base64(s, b->length,
1874  istext || (((WithCrypto & APPLICATION_PGP) != 0) &&
1876  cd);
1877  break;
1878  case ENC_UUENCODED:
1879  decode_uuencoded(s, b->length,
1880  istext || (((WithCrypto & APPLICATION_PGP) != 0) &&
1882  cd);
1883  break;
1884  default:
1885  decode_xbit(s, b->length,
1886  istext || (((WithCrypto & APPLICATION_PGP) != 0) &&
1888  cd);
1889  break;
1890  }
1891 
1892  if (cd != (iconv_t)(-1))
1893  iconv_close(cd);
1894 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_decode_base64()

void mutt_decode_base64 ( struct State s,
size_t  len,
bool  istext,
iconv_t  cd 
)

Decode base64-encoded text.

Parameters
sState to work with
lenLength of text to decode
istextMime part is plain text
cdIconv conversion descriptor

Definition at line 1496 of file handler.c.

1497 {
1498  char buf[5];
1499  int ch, i;
1500  bool cr = false;
1501  char bufi[BUFI_SIZE];
1502  size_t l = 0;
1503 
1504  buf[4] = '\0';
1505 
1506  if (istext)
1507  state_set_prefix(s);
1508 
1509  while (len > 0)
1510  {
1511  for (i = 0; (i < 4) && (len > 0); len--)
1512  {
1513  ch = fgetc(s->fp_in);
1514  if (ch == EOF)
1515  break;
1516  if ((ch >= 0) && (ch < 128) && ((base64val(ch) != -1) || (ch == '=')))
1517  buf[i++] = ch;
1518  }
1519  if (i != 4)
1520  {
1521  /* "i" may be zero if there is trailing whitespace, which is not an error */
1522  if (i != 0)
1523  mutt_debug(LL_DEBUG2, "didn't get a multiple of 4 chars\n");
1524  break;
1525  }
1526 
1527  const int c1 = base64val(buf[0]);
1528  const int c2 = base64val(buf[1]);
1529 
1530  /* first char */
1531  ch = (c1 << 2) | (c2 >> 4);
1532 
1533  if (cr && (ch != '\n'))
1534  bufi[l++] = '\r';
1535 
1536  cr = false;
1537 
1538  if (istext && (ch == '\r'))
1539  cr = true;
1540  else
1541  bufi[l++] = ch;
1542 
1543  /* second char */
1544  if (buf[2] == '=')
1545  break;
1546  const int c3 = base64val(buf[2]);
1547  ch = ((c2 & 0xf) << 4) | (c3 >> 2);
1548 
1549  if (cr && (ch != '\n'))
1550  bufi[l++] = '\r';
1551 
1552  cr = false;
1553 
1554  if (istext && (ch == '\r'))
1555  cr = true;
1556  else
1557  bufi[l++] = ch;
1558 
1559  /* third char */
1560  if (buf[3] == '=')
1561  break;
1562  const int c4 = base64val(buf[3]);
1563  ch = ((c3 & 0x3) << 6) | c4;
1564 
1565  if (cr && (ch != '\n'))
1566  bufi[l++] = '\r';
1567 
1568  cr = false;
1569 
1570  if (istext && (ch == '\r'))
1571  cr = true;
1572  else
1573  bufi[l++] = ch;
1574 
1575  if ((l + 8) >= sizeof(bufi))
1576  convert_to_state(cd, bufi, &l, s);
1577  }
1578 
1579  if (cr)
1580  bufi[l++] = '\r';
1581 
1582  convert_to_state(cd, bufi, &l, s);
1583  convert_to_state(cd, 0, 0, s);
1584 
1585  state_reset_prefix(s);
1586 }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ C_HonorDisposition

bool C_HonorDisposition

Config: Don't display MIME parts inline if they have a disposition of 'attachment'.

Definition at line 65 of file handler.c.

◆ C_ImplicitAutoview

bool C_ImplicitAutoview

Config: Display MIME attachments inline if a 'copiousoutput' mailcap entry exists.

Definition at line 66 of file handler.c.

◆ C_IncludeEncrypted

bool C_IncludeEncrypted

Config: Whether to include encrypted content when replying.

Definition at line 67 of file handler.c.

◆ C_IncludeOnlyFirst

bool C_IncludeOnlyFirst

Config: Only include the first attachment when replying.

Definition at line 68 of file handler.c.

◆ C_PreferredLanguages

struct Slist* C_PreferredLanguages

Config: Preferred languages for multilingual MIME.

Definition at line 69 of file handler.c.

◆ C_ReflowText

bool C_ReflowText

Config: Reformat paragraphs of 'format=flowed' text.

Definition at line 70 of file handler.c.

◆ C_ShowMultipartAlternative

char* C_ShowMultipartAlternative

Config: How to display 'multipart/alternative' MIME parts.

Definition at line 71 of file handler.c.

ENC_BINARY
@ ENC_BINARY
Binary.
Definition: mime.h:53
decode_uuencoded
static void decode_uuencoded(struct State *s, long len, bool istext, iconv_t cd)
Decode uuencoded text.
Definition: handler.c:372
ENC_QUOTED_PRINTABLE
@ ENC_QUOTED_PRINTABLE
Quoted-printable text.
Definition: mime.h:51
State::fp_in
FILE * fp_in
File to read from.
Definition: state.h:46
_
#define _(a)
Definition: message.h:28
NONULL
#define NONULL(x)
Definition: string2.h:37
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_DISPLAY
#define MUTT_DISPLAY
Output is displayed to the user.
Definition: state.h:32
Buffer
String manipulation buffer.
Definition: buffer.h:33
Body::offset
LOFF_T offset
offset where the actual data begins
Definition: body.h:44
mutt_is_malformed_multipart_pgp_encrypted
SecurityFlags mutt_is_malformed_multipart_pgp_encrypted(struct Body *b)
Check for malformed layout.
Definition: crypt.c:510
Body::next
struct Body * next
next attachment in the list
Definition: body.h:53
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
LL_DEBUG1
@ LL_DEBUG1
Log at debug level 1.
Definition: logging.h:40
mutt_is_valid_multipart_pgp_encrypted
int mutt_is_valid_multipart_pgp_encrypted(struct Body *b)
Is this a valid multi-part encrypted message?
Definition: crypt.c:473
Body::disposition
unsigned int disposition
content-disposition, ContentDisposition
Definition: body.h:67
mutt_decode_base64
void mutt_decode_base64(struct State *s, size_t len, bool istext, iconv_t cd)
Decode base64-encoded text.
Definition: handler.c:1496
handler_t
int(* handler_t)(struct Body *b, struct State *s)
Manage a PGP or S/MIME encrypted MIME part.
Definition: handler.c:87
Body::encoding
unsigned int encoding
content-transfer-encoding, ContentEncoding
Definition: body.h:66
DISP_ATTACH
@ DISP_ATTACH
Content is attached.
Definition: mime.h:63
mutt_ch_get_default_charset
char * mutt_ch_get_default_charset(void)
Get the default character set.
Definition: charset.c:440
decode_quoted
static void decode_quoted(struct State *s, long len, bool istext, iconv_t cd)
Decode an attachment encoded with quoted-printable.
Definition: handler.c:308
Body::subtype
char * subtype
content-type subtype
Definition: body.h:37
text_enriched_handler
int text_enriched_handler(struct Body *a, struct State *s)
Handler for enriched text - Implements handler_t.
Definition: enriched.c:460
mutt_ch_iconv_open
iconv_t mutt_ch_iconv_open(const char *tocode, const char *fromcode, uint8_t flags)
Set up iconv for conversions.
Definition: charset.c:565
mutt_istr_equal
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition: string.c:883
mutt_str_equal
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:871
MUTT_ICONV_HOOK_FROM
#define MUTT_ICONV_HOOK_FROM
apply charset-hooks to fromcode
Definition: charset.h:74
mutt_is_application_pgp
SecurityFlags mutt_is_application_pgp(struct Body *m)
Does the message use PGP?
Definition: crypt.c:554
C_ReflowText
bool C_ReflowText
Config: Reformat paragraphs of 'format=flowed' text.
Definition: handler.c:70
mutt_can_decode
bool mutt_can_decode(struct Body *a)
Will decoding the attachment produce any output.
Definition: handler.c:1805
malformed_pgp_encrypted_handler
static int malformed_pgp_encrypted_handler(struct Body *b, struct State *s)
Handler for invalid pgp-encrypted emails - Implements handler_t.
Definition: handler.c:1464
km_find_func
struct Keymap * km_find_func(enum MenuType menu, int func)
Find a function's mapping in a Menu.
Definition: keymap.c:939
MUTT_CHARCONV
#define MUTT_CHARCONV
Do character set conversions.
Definition: state.h:36
TYPE
#define TYPE(body)
Definition: mime.h:89
MUTT_VERIFY
#define MUTT_VERIFY
Perform signature verification.
Definition: state.h:33
Body::length
LOFF_T length
length (in bytes) of attachment
Definition: body.h:45
ENC_8BIT
@ ENC_8BIT
8-bit text
Definition: mime.h:50
APPLICATION_PGP
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition: lib.h:97
mutt_signed_handler
int mutt_signed_handler(struct Body *a, struct State *s)
Verify a "multipart/signed" body - Implements handler_t.
Definition: crypt.c:1116
OptDontHandlePgpKeys
WHERE bool OptDontHandlePgpKeys
(pseudo) used to extract PGP keys
Definition: options.h:36
MUTT_FIRSTDONE
#define MUTT_FIRSTDONE
The first attachment has been done.
Definition: state.h:39
valid_pgp_encrypted_handler
static int valid_pgp_encrypted_handler(struct Body *b, struct State *s)
Handler for valid pgp-encrypted emails - Implements handler_t.
Definition: handler.c:1435
km_expand_key
int km_expand_key(char *s, size_t len, struct Keymap *map)
Get the key string bound to a Keymap.
Definition: keymap.c:911
MUTT_REPLYING
#define MUTT_REPLYING
Are we replying?
Definition: state.h:38
mutt_is_message_type
bool mutt_is_message_type(int type, const char *subtype)
Determine if a mime type matches a message or not.
Definition: parse.c:1368
Body::parts
struct Body * parts
parts of a multipart or message/rfc822
Definition: body.h:54
TYPE_MESSAGE
@ TYPE_MESSAGE
Type: 'message/*'.
Definition: mime.h:35
Body::charset
char * charset
Send mode: charset of attached file as stored on disk.
Definition: body.h:49
mutt_debug
#define mutt_debug(LEVEL,...)
Definition: logging.h:81
state_printf
int state_printf(struct State *s, const char *fmt,...)
Write a formatted string to the State.
Definition: state.c:153
base64val
#define base64val(ch)
Definition: base64.h:30
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
message_handler
static int message_handler(struct Body *a, struct State *s)
Handler for message/rfc822 body parts - Implements handler_t.
Definition: handler.c:708
crypt_pgp_application_handler
int crypt_pgp_application_handler(struct Body *m, struct State *s)
Wrapper for CryptModuleSpecs::application_handler()
Definition: cryptglue.c:236
WithCrypto
#define WithCrypto
Definition: lib.h:123
BUFI_SIZE
#define BUFI_SIZE
Definition: handler.c:73
mutt_param_get
char * mutt_param_get(const struct ParameterList *pl, const char *s)
Find a matching Parameter.
Definition: parameter.c:84
multilingual_handler
static int multilingual_handler(struct Body *a, struct State *s)
Handler for multi-lingual emails - Implements handler_t.
Definition: handler.c:1113
TYPE_APPLICATION
@ TYPE_APPLICATION
Type: 'application/*'.
Definition: mime.h:33
ENC_BASE64
@ ENC_BASE64
Base-64 encoded text.
Definition: mime.h:52
TYPE_TEXT
@ TYPE_TEXT
Type: 'text/*'.
Definition: mime.h:38
run_decode_and_handler
static int run_decode_and_handler(struct Body *b, struct State *s, handler_t handler, bool plaintext)
Run an appropriate decoder for an email.
Definition: handler.c:1295
DISP_INLINE
@ DISP_INLINE
Content is inline.
Definition: mime.h:62
C_AssumedCharset
char * C_AssumedCharset
Config: If a message is missing a character set, assume this character set.
Definition: charset.c:52
C_ShowMultipartAlternative
char * C_ShowMultipartAlternative
Config: How to display 'multipart/alternative' MIME parts.
Definition: handler.c:71
Body::type
unsigned int type
content-type primary type, ContentType
Definition: body.h:65
multipart_handler
static int multipart_handler(struct Body *a, struct State *s)
Handler for multipart emails - Implements handler_t.
Definition: handler.c:1211
OptViewAttach
WHERE bool OptViewAttach
(pseudo) signals that we are viewing attachments
Definition: options.h:55
MUTT_MIME_MAX_DEPTH
#define MUTT_MIME_MAX_DEPTH
Definition: mime.h:69
C_IncludeEncrypted
bool C_IncludeEncrypted
Config: Whether to include encrypted content when replying.
Definition: handler.c:67
state_set_prefix
#define state_set_prefix(state)
Definition: state.h:53
external_body_handler
static int external_body_handler(struct Body *b, struct State *s)
Handler for external-body emails - Implements handler_t.
Definition: handler.c:761
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
rfc3676_handler
int rfc3676_handler(struct Body *a, struct State *s)
Body handler implementing RFC3676 for format=flowed - Implements handler_t.
Definition: rfc3676.c:316
C_HonorDisposition
bool C_HonorDisposition
Config: Don't display MIME parts inline if they have a disposition of 'attachment'.
Definition: handler.c:65
Body::parameter
struct ParameterList parameter
parameters of the content-type
Definition: body.h:39
State::flags
StateFlags flags
Flags, e.g. MUTT_DISPLAY.
Definition: state.h:49
C_Charset
char * C_Charset
Config: Default character set for displaying text on screen.
Definition: charset.c:53
TYPE_MULTIPART
@ TYPE_MULTIPART
Type: 'multipart/*'.
Definition: mime.h:37
decode_xbit
static void decode_xbit(struct State *s, long len, bool istext, iconv_t cd)
Decode xbit-encoded text.
Definition: handler.c:171
autoview_handler
static int autoview_handler(struct Body *a, struct State *s)
Handler for autoviewable attachments - Implements handler_t.
Definition: handler.c:529
mutt_buffer_printf
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition: buffer.c:160
is_autoview
static bool is_autoview(struct Body *b)
Should email body be filtered by mailcap.
Definition: handler.c:484
mutt_buffer_make
struct Buffer mutt_buffer_make(size_t size)
Make a new buffer on the stack.
Definition: buffer.c:61
state_reset_prefix
#define state_reset_prefix(state)
Definition: state.h:54
alternative_handler
static int alternative_handler(struct Body *a, struct State *s)
Handler for multipart alternative emails - Implements handler_t.
Definition: handler.c:932
text_plain_handler
static int text_plain_handler(struct Body *b, struct State *s)
Handler for plain text - Implements handler_t.
Definition: handler.c:682
MENU_PAGER
@ MENU_PAGER
Pager pager (email viewer)
Definition: keymap.h:81
mutt_buffer_strcpy
size_t mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition: buffer.c:312
convert_to_state
static void convert_to_state(iconv_t cd, char *bufi, size_t *l, struct State *s)
Convert text and write it to a file.
Definition: handler.c:122
LL_DEBUG2
@ LL_DEBUG2
Log at debug level 2.
Definition: logging.h:41
mutt_is_application_smime
SecurityFlags mutt_is_application_smime(struct Body *m)
Does the message use S/MIME?
Definition: crypt.c:612
ENC_7BIT
@ ENC_7BIT
7-bit text
Definition: mime.h:49
crypt_smime_application_handler
int crypt_smime_application_handler(struct Body *m, struct State *s)
Wrapper for CryptModuleSpecs::application_handler()
Definition: cryptglue.c:447
mutt_error
#define mutt_error(...)
Definition: logging.h:84
state_mark_attach
void state_mark_attach(struct State *s)
Write a unique marker around content.
Definition: state.c:41