NeoMutt
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
handler.h File Reference

Decide how to display email content. More...

#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 *state)
 Handler for the Body of an email.
 
bool mutt_can_decode (struct Body *b)
 Will decoding the attachment produce any output.
 
void mutt_decode_attachment (struct Body *b, struct State *state)
 Decode an email's attachment.
 
void mutt_decode_base64 (struct State *state, size_t len, bool istext, iconv_t cd)
 Decode base64-encoded text.
 
bool mutt_prefer_as_attachment (struct Body *b)
 Do we want this part as an attachment?
 

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 state 
)

Handler for the Body of an email.

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

Definition at line 1618 of file handler.c.

1619{
1620 if (!b || !state)
1621 return -1;
1622
1623 bool plaintext = false;
1624 handler_t handler = NULL;
1625 handler_t encrypted_handler = NULL;
1626 int rc = 0;
1627 static unsigned short recurse_level = 0;
1628
1629 const int oflags = state->flags;
1630 const bool is_attachment_display = (oflags & STATE_DISPLAY_ATTACH);
1631
1632 if (recurse_level >= MUTT_MIME_MAX_DEPTH)
1633 {
1634 mutt_debug(LL_DEBUG1, "recurse level too deep. giving up.\n");
1635 return 1;
1636 }
1637 recurse_level++;
1638
1639 /* first determine which handler to use to process this part */
1640
1641 if (is_autoview(b))
1642 {
1643 handler = autoview_handler;
1644 state->flags &= ~STATE_CHARCONV;
1645 }
1646 else if (b->type == TYPE_TEXT)
1647 {
1648 if (mutt_istr_equal("plain", b->subtype))
1649 {
1650 const bool c_reflow_text = cs_subset_bool(NeoMutt->sub, "reflow_text");
1651 /* avoid copying this part twice since removing the transfer-encoding is
1652 * the only operation needed. */
1654 {
1655 encrypted_handler = crypt_pgp_application_handler;
1656 handler = encrypted_handler;
1657 }
1658 else if (c_reflow_text &&
1659 mutt_istr_equal("flowed", mutt_param_get(&b->parameter, "format")))
1660 {
1661 handler = rfc3676_handler;
1662 }
1663 else
1664 {
1665 handler = text_plain_handler;
1666 }
1667 }
1668 else if (mutt_istr_equal("enriched", b->subtype))
1669 {
1670 handler = text_enriched_handler;
1671 }
1672 else /* text body type without a handler */
1673 {
1674 plaintext = false;
1675 }
1676 }
1677 else if (b->type == TYPE_MESSAGE)
1678 {
1679 if (mutt_is_message_type(b->type, b->subtype))
1680 handler = message_handler;
1681 else if (mutt_istr_equal("delivery-status", b->subtype))
1682 plaintext = true;
1683 else if (mutt_istr_equal("external-body", b->subtype))
1684 handler = external_body_handler;
1685 }
1686 else if (b->type == TYPE_MULTIPART)
1687 {
1688 const char *const c_show_multipart_alternative = cs_subset_string(NeoMutt->sub, "show_multipart_alternative");
1689 if (!mutt_str_equal("inline", c_show_multipart_alternative) &&
1690 mutt_istr_equal("alternative", b->subtype))
1691 {
1692 handler = alternative_handler;
1693 }
1694 else if (!mutt_str_equal("inline", c_show_multipart_alternative) &&
1695 mutt_istr_equal("multilingual", b->subtype))
1696 {
1697 handler = multilingual_handler;
1698 }
1699 else if ((WithCrypto != 0) && mutt_istr_equal("signed", b->subtype))
1700 {
1701 if (!mutt_param_get(&b->parameter, "protocol"))
1702 mutt_error(_("Error: multipart/signed has no protocol"));
1703 else if (state->flags & STATE_VERIFY)
1704 handler = mutt_signed_handler;
1705 }
1707 {
1708 encrypted_handler = valid_pgp_encrypted_handler;
1709 handler = encrypted_handler;
1710 }
1712 {
1713 encrypted_handler = malformed_pgp_encrypted_handler;
1714 handler = encrypted_handler;
1715 }
1716
1717 if (!handler)
1718 handler = multipart_handler;
1719
1720 if ((b->encoding != ENC_7BIT) && (b->encoding != ENC_8BIT) && (b->encoding != ENC_BINARY))
1721 {
1722 mutt_debug(LL_DEBUG1, "Bad encoding type %d for multipart entity, assuming 7 bit\n",
1723 b->encoding);
1724 b->encoding = ENC_7BIT;
1725 }
1726 }
1727 else if ((WithCrypto != 0) && (b->type == TYPE_APPLICATION))
1728 {
1729 if (OptDontHandlePgpKeys && mutt_istr_equal("pgp-keys", b->subtype))
1730 {
1731 /* pass raw part through for key extraction */
1732 plaintext = true;
1733 }
1734 else if (((WithCrypto & APPLICATION_PGP) != 0) && mutt_is_application_pgp(b))
1735 {
1736 encrypted_handler = crypt_pgp_application_handler;
1737 handler = encrypted_handler;
1738 }
1739 else if (((WithCrypto & APPLICATION_SMIME) != 0) && mutt_is_application_smime(b))
1740 {
1741 encrypted_handler = crypt_smime_application_handler;
1742 handler = encrypted_handler;
1743 }
1744 }
1745
1746 if ((plaintext || handler) && (is_attachment_display || !mutt_prefer_as_attachment(b)))
1747 {
1748 /* only respect disposition == attachment if we're not
1749 * displaying from the attachment menu (i.e. pager) */
1750 /* Prevent encrypted attachments from being included in replies
1751 * unless $include_encrypted is set. */
1752 const bool c_include_encrypted = cs_subset_bool(NeoMutt->sub, "include_encrypted");
1753 if ((state->flags & STATE_REPLYING) && (state->flags & STATE_FIRSTDONE) &&
1754 encrypted_handler && !c_include_encrypted)
1755 {
1756 goto cleanup;
1757 }
1758
1759 rc = run_decode_and_handler(b, state, handler, plaintext);
1760 }
1761 else if (state->flags & STATE_DISPLAY)
1762 {
1763 /* print hint to use attachment menu for disposition == attachment
1764 * if we're not already being called from there */
1765 const bool c_honor_disposition = cs_subset_bool(NeoMutt->sub, "honor_disposition");
1766 struct Buffer msg = buf_make(256);
1767
1768 if (is_attachment_display)
1769 {
1770 if (c_honor_disposition && (b->disposition == DISP_ATTACH))
1771 {
1772 buf_strcpy(&msg, _("[-- This is an attachment --]\n"));
1773 }
1774 else
1775 {
1776 /* L10N: %s/%s is a MIME type, e.g. "text/plain". */
1777 buf_printf(&msg, _("[-- %s/%s is unsupported --]\n"), TYPE(b), b->subtype);
1778 }
1779 }
1780 else
1781 {
1782 char keystroke[128] = { 0 };
1783 if (km_expand_key(keystroke, sizeof(keystroke),
1784 km_find_func(MENU_PAGER, OP_VIEW_ATTACHMENTS)))
1785 {
1786 if (c_honor_disposition && (b->disposition == DISP_ATTACH))
1787 {
1788 /* L10N: %s expands to a keystroke/key binding, e.g. 'v'. */
1789 buf_printf(&msg, _("[-- This is an attachment (use '%s' to view this part) --]\n"),
1790 keystroke);
1791 }
1792 else
1793 {
1794 /* L10N: %s/%s is a MIME type, e.g. "text/plain".
1795 The last %s expands to a keystroke/key binding, e.g. 'v'. */
1796 buf_printf(&msg, _("[-- %s/%s is unsupported (use '%s' to view this part) --]\n"),
1797 TYPE(b), b->subtype, keystroke);
1798 }
1799 }
1800 else
1801 {
1802 if (c_honor_disposition && (b->disposition == DISP_ATTACH))
1803 {
1804 buf_strcpy(&msg, _("[-- This is an attachment (need 'view-attachments' bound to key) --]\n"));
1805 }
1806 else
1807 {
1808 /* L10N: %s/%s is a MIME type, e.g. "text/plain". */
1809 buf_printf(&msg, _("[-- %s/%s is unsupported (need 'view-attachments' bound to key) --]\n"),
1810 TYPE(b), b->subtype);
1811 }
1812 }
1813 }
1814 state_mark_attach(state);
1815 state_printf(state, "%s", buf_string(&msg));
1816 buf_dealloc(&msg);
1817 }
1818
1819cleanup:
1820 recurse_level--;
1821 state->flags = oflags | (state->flags & STATE_FIRSTDONE);
1822 if (rc != 0)
1823 {
1824 mutt_debug(LL_DEBUG1, "Bailing on attachment of type %s/%s\n", TYPE(b),
1825 NONULL(b->subtype));
1826 }
1827
1828 return rc;
1829}
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition: buffer.c:173
void buf_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
Definition: buffer.c:389
struct Buffer buf_make(size_t size)
Make a new buffer on the stack.
Definition: buffer.c:70
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition: buffer.c:407
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition: buffer.h:93
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:292
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition: helpers.c:48
SecurityFlags mutt_is_application_pgp(struct Body *b)
Does the message use PGP?
Definition: crypt.c:537
SecurityFlags mutt_is_application_smime(struct Body *b)
Does the message use S/MIME?
Definition: crypt.c:598
int mutt_is_valid_multipart_pgp_encrypted(struct Body *b)
Is this a valid multi-part encrypted message?
Definition: crypt.c:456
SecurityFlags mutt_is_malformed_multipart_pgp_encrypted(struct Body *b)
Check for malformed layout.
Definition: crypt.c:493
bool mutt_is_message_type(int type, const char *subtype)
Determine if a mime type matches a message or not.
Definition: parse.c:1482
bool OptDontHandlePgpKeys
(pseudo) used to extract PGP keys
Definition: globals.c:69
static int alternative_handler(struct Body *a, struct State *state)
Handler for multipart alternative emails - Implements handler_t -.
Definition: handler.c:934
int crypt_pgp_application_handler(struct Body *b, struct State *state)
Wrapper for CryptModuleSpecs::application_handler() - Implements handler_t -.
Definition: cryptglue.c:237
int crypt_smime_application_handler(struct Body *b, struct State *state)
Wrapper for CryptModuleSpecs::application_handler() - Implements handler_t -.
Definition: cryptglue.c:444
static int multipart_handler(struct Body *a, struct State *state)
Handler for multipart emails - Implements handler_t -.
Definition: handler.c:1226
static int text_plain_handler(struct Body *b, struct State *state)
Handler for plain text - Implements handler_t -.
Definition: handler.c:677
static int external_body_handler(struct Body *b, struct State *state)
Handler for external-body emails - Implements handler_t -.
Definition: handler.c:762
static int multilingual_handler(struct Body *a, struct State *state)
Handler for multi-lingual emails - Implements handler_t -.
Definition: handler.c:1120
static int message_handler(struct Body *a, struct State *state)
Handler for message/rfc822 body parts - Implements handler_t -.
Definition: handler.c:704
int mutt_signed_handler(struct Body *b, struct State *state)
Verify a "multipart/signed" body - Implements handler_t -.
Definition: crypt.c:1136
static int malformed_pgp_encrypted_handler(struct Body *b, struct State *state)
Handler for invalid pgp-encrypted emails - Implements handler_t -.
Definition: handler.c:1487
static int autoview_handler(struct Body *a, struct State *state)
Handler for autoviewable attachments - Implements handler_t -.
Definition: handler.c:524
static int valid_pgp_encrypted_handler(struct Body *b, struct State *state)
Handler for valid pgp-encrypted emails - Implements handler_t -.
Definition: handler.c:1458
int rfc3676_handler(struct Body *a, struct State *state)
Body handler implementing RFC3676 for format=flowed - Implements handler_t -.
Definition: rfc3676.c:320
int text_enriched_handler(struct Body *a, struct State *state)
Handler for enriched text - Implements handler_t -.
Definition: enriched.c:466
#define mutt_error(...)
Definition: logging2.h:92
#define mutt_debug(LEVEL,...)
Definition: logging2.h:89
static bool is_autoview(struct Body *b)
Should email body be filtered by mailcap.
Definition: handler.c:478
bool mutt_prefer_as_attachment(struct Body *b)
Do we want this part as an attachment?
Definition: handler.c:1836
static int run_decode_and_handler(struct Body *b, struct State *state, handler_t handler, bool plaintext)
Run an appropriate decoder for an email.
Definition: handler.c:1313
int(* handler_t)(struct Body *b, struct State *state)
Definition: handler.c:78
struct Keymap * km_find_func(enum MenuType mtype, int func)
Find a function's mapping in a Menu.
Definition: lib.c:516
int km_expand_key(char *s, size_t len, struct Keymap *map)
Get the key string bound to a Keymap.
Definition: lib.c:464
@ LL_DEBUG1
Log at debug level 1.
Definition: logging2.h:43
@ ENC_7BIT
7-bit text
Definition: mime.h:49
@ ENC_BINARY
Binary.
Definition: mime.h:53
@ ENC_8BIT
8-bit text
Definition: mime.h:50
#define MUTT_MIME_MAX_DEPTH
Definition: mime.h:69
@ TYPE_MESSAGE
Type: 'message/*'.
Definition: mime.h:35
@ TYPE_MULTIPART
Type: 'multipart/*'.
Definition: mime.h:37
@ TYPE_APPLICATION
Type: 'application/*'.
Definition: mime.h:33
@ TYPE_TEXT
Type: 'text/*'.
Definition: mime.h:38
@ DISP_ATTACH
Content is attached.
Definition: mime.h:63
#define TYPE(body)
Definition: mime.h:89
#define _(a)
Definition: message.h:28
void state_mark_attach(struct State *state)
Write a unique marker around content.
Definition: state.c:71
int state_printf(struct State *state, const char *fmt,...)
Write a formatted string to the State.
Definition: state.c:185
#define STATE_DISPLAY
Output is displayed to the user.
Definition: state.h:32
#define STATE_DISPLAY_ATTACH
We are displaying an attachment.
Definition: state.h:40
#define STATE_FIRSTDONE
The first attachment has been done.
Definition: state.h:39
#define STATE_REPLYING
Are we replying?
Definition: state.h:38
#define STATE_VERIFY
Perform signature verification.
Definition: state.h:33
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition: string.c:810
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:798
#define APPLICATION_PGP
Use PGP to encrypt/sign.
Definition: lib.h:91
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
Definition: lib.h:92
#define WithCrypto
Definition: lib.h:117
char * mutt_param_get(const struct ParameterList *pl, const char *s)
Find a matching Parameter.
Definition: parameter.c:84
#define NONULL(x)
Definition: string2.h:37
struct ParameterList parameter
Parameters of the content-type.
Definition: body.h:62
unsigned int disposition
content-disposition, ContentDisposition
Definition: body.h:42
char * subtype
content-type subtype
Definition: body.h:60
unsigned int encoding
content-transfer-encoding, ContentEncoding
Definition: body.h:41
unsigned int type
content-type primary type, ContentType
Definition: body.h:40
String manipulation buffer.
Definition: buffer.h:34
Container for Accounts, Notifications.
Definition: neomutt.h:41
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:45
StateFlags flags
Flags, e.g. STATE_DISPLAY.
Definition: state.h:51
@ MENU_PAGER
Pager pager (email viewer)
Definition: type.h:55
+ 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 b)

Will decoding the attachment produce any output.

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

Definition at line 1852 of file handler.c.

1853{
1854 if (is_autoview(b))
1855 return true;
1856 if (b->type == TYPE_TEXT)
1857 return true;
1858 if (b->type == TYPE_MESSAGE)
1859 return true;
1860 if (b->type == TYPE_MULTIPART)
1861 {
1862 if (WithCrypto)
1863 {
1864 if (mutt_istr_equal(b->subtype, "signed") || mutt_istr_equal(b->subtype, "encrypted"))
1865 {
1866 return true;
1867 }
1868 }
1869
1870 for (struct Body *part = b->parts; part; part = part->next)
1871 {
1872 if (mutt_can_decode(part))
1873 return true;
1874 }
1875 }
1876 else if ((WithCrypto != 0) && (b->type == TYPE_APPLICATION))
1877 {
1879 return true;
1881 return true;
1882 }
1883
1884 return false;
1885}
bool mutt_can_decode(struct Body *b)
Will decoding the attachment produce any output.
Definition: handler.c:1852
The body of an email.
Definition: body.h:36
struct Body * parts
parts of a multipart or message/rfc822
Definition: body.h:72
struct Body * next
next attachment in the list
Definition: body.h:71
+ 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 state 
)

Decode an email's attachment.

Parameters
bBody of the email
stateState of text being processed

Definition at line 1892 of file handler.c.

1893{
1894 int istext = mutt_is_text_part(b) && (b->disposition == DISP_INLINE);
1895 iconv_t cd = ICONV_T_INVALID;
1896
1897 if (!mutt_file_seek(state->fp_in, b->offset, SEEK_SET))
1898 {
1899 return;
1900 }
1901
1902 if (istext && (b->charset || (state->flags & STATE_CHARCONV)))
1903 {
1904 const char *charset = b->charset;
1905 if (!charset)
1906 {
1907 charset = mutt_param_get(&b->parameter, "charset");
1908 if (!charset && !slist_is_empty(cc_assumed_charset()))
1910 }
1911 if (charset && cc_charset())
1913 }
1914
1915 switch (b->encoding)
1916 {
1918 decode_quoted(state, b->length,
1919 istext || (((WithCrypto & APPLICATION_PGP) != 0) &&
1921 cd);
1922 break;
1923 case ENC_BASE64:
1924 mutt_decode_base64(state, b->length,
1925 istext || (((WithCrypto & APPLICATION_PGP) != 0) &&
1927 cd);
1928 break;
1929 case ENC_UUENCODED:
1930 decode_uuencoded(state, b->length,
1931 istext || (((WithCrypto & APPLICATION_PGP) != 0) &&
1933 cd);
1934 break;
1935 default:
1936 decode_xbit(state, b->length,
1937 istext || (((WithCrypto & APPLICATION_PGP) != 0) &&
1939 cd);
1940 break;
1941 }
1942}
const char * cc_charset(void)
Get the cached value of $charset.
Definition: config_cache.c:115
const struct Slist * cc_assumed_charset(void)
Get the cached value of $assumed_charset.
Definition: config_cache.c:100
bool mutt_file_seek(FILE *fp, LOFF_T offset, int whence)
Wrapper for fseeko with error handling.
Definition: file.c:733
static void decode_uuencoded(struct State *state, long len, bool istext, iconv_t cd)
Decode uuencoded text.
Definition: handler.c:365
void mutt_decode_base64(struct State *state, size_t len, bool istext, iconv_t cd)
Decode base64-encoded text.
Definition: handler.c:1519
static void decode_quoted(struct State *state, long len, bool istext, iconv_t cd)
Decode an attachment encoded with quoted-printable.
Definition: handler.c:301
static void decode_xbit(struct State *state, long len, bool istext, iconv_t cd)
Decode xbit-encoded text.
Definition: handler.c:162
@ ENC_UUENCODED
UUEncoded text.
Definition: mime.h:54
@ ENC_BASE64
Base-64 encoded text.
Definition: mime.h:52
@ ENC_QUOTED_PRINTABLE
Quoted-printable text.
Definition: mime.h:51
@ DISP_INLINE
Content is inline.
Definition: mime.h:62
iconv_t mutt_ch_iconv_open(const char *tocode, const char *fromcode, uint8_t flags)
Set up iconv for conversions.
Definition: charset.c:589
const char * mutt_ch_get_default_charset(const struct Slist *const assumed_charset)
Get the default character set.
Definition: charset.c:460
#define MUTT_ICONV_HOOK_FROM
apply charset-hooks to fromcode
Definition: charset.h:72
#define ICONV_T_INVALID
Error value for iconv functions.
Definition: charset.h:100
bool slist_is_empty(const struct Slist *list)
Is the slist empty?
Definition: slist.c:178
#define STATE_CHARCONV
Do character set conversions.
Definition: state.h:36
bool mutt_is_text_part(struct Body *b)
Is this part of an email in plain text?
Definition: muttlib.c:450
LOFF_T offset
offset where the actual data begins
Definition: body.h:52
LOFF_T length
length (in bytes) of attachment
Definition: body.h:53
char * charset
Send mode: charset of attached file as stored on disk.
Definition: body.h:78
FILE * fp_in
File to read from.
Definition: state.h:48
+ 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 state,
size_t  len,
bool  istext,
iconv_t  cd 
)

Decode base64-encoded text.

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

Definition at line 1519 of file handler.c.

1520{
1521 char buf[5] = { 0 };
1522 int ch, i;
1523 bool cr = false;
1524 char bufi[BUFI_SIZE] = { 0 };
1525 size_t l = 0;
1526
1527 buf[4] = '\0';
1528
1529 if (istext)
1530 state_set_prefix(state);
1531
1532 while (len > 0)
1533 {
1534 for (i = 0; (i < 4) && (len > 0); len--)
1535 {
1536 ch = fgetc(state->fp_in);
1537 if (ch == EOF)
1538 break;
1539 if ((ch >= 0) && (ch < 128) && ((base64val(ch) != -1) || (ch == '=')))
1540 buf[i++] = ch;
1541 }
1542 if (i != 4)
1543 {
1544 /* "i" may be zero if there is trailing whitespace, which is not an error */
1545 if (i != 0)
1546 mutt_debug(LL_DEBUG2, "didn't get a multiple of 4 chars\n");
1547 break;
1548 }
1549
1550 const int c1 = base64val(buf[0]);
1551 const int c2 = base64val(buf[1]);
1552
1553 /* first char */
1554 ch = (c1 << 2) | (c2 >> 4);
1555
1556 if (cr && (ch != '\n'))
1557 bufi[l++] = '\r';
1558
1559 cr = false;
1560
1561 if (istext && (ch == '\r'))
1562 cr = true;
1563 else
1564 bufi[l++] = ch;
1565
1566 /* second char */
1567 if (buf[2] == '=')
1568 break;
1569 const int c3 = base64val(buf[2]);
1570 ch = ((c2 & 0xf) << 4) | (c3 >> 2);
1571
1572 if (cr && (ch != '\n'))
1573 bufi[l++] = '\r';
1574
1575 cr = false;
1576
1577 if (istext && (ch == '\r'))
1578 cr = true;
1579 else
1580 bufi[l++] = ch;
1581
1582 /* third char */
1583 if (buf[3] == '=')
1584 break;
1585 const int c4 = base64val(buf[3]);
1586 ch = ((c3 & 0x3) << 6) | c4;
1587
1588 if (cr && (ch != '\n'))
1589 bufi[l++] = '\r';
1590
1591 cr = false;
1592
1593 if (istext && (ch == '\r'))
1594 cr = true;
1595 else
1596 bufi[l++] = ch;
1597
1598 if ((l + 8) >= sizeof(bufi))
1599 convert_to_state(cd, bufi, &l, state);
1600 }
1601
1602 if (cr)
1603 bufi[l++] = '\r';
1604
1605 convert_to_state(cd, bufi, &l, state);
1606 convert_to_state(cd, 0, 0, state);
1607
1608 state_reset_prefix(state);
1609}
#define base64val(ch)
Definition: base64.h:30
#define BUFI_SIZE
Definition: handler.c:61
static void convert_to_state(iconv_t cd, char *bufi, size_t *l, struct State *state)
Convert text and write it to a file.
Definition: handler.c:113
@ LL_DEBUG2
Log at debug level 2.
Definition: logging2.h:44
#define state_set_prefix(state)
Definition: state.h:55
#define state_reset_prefix(state)
Definition: state.h:56
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_prefer_as_attachment()

bool mutt_prefer_as_attachment ( struct Body b)

Do we want this part as an attachment?

Parameters
bBody of email to test
Return values
trueWe want this part as an attachment

Definition at line 1836 of file handler.c.

1837{
1838 if (!mutt_can_decode(b))
1839 return true;
1840
1841 if (b->disposition != DISP_ATTACH)
1842 return false;
1843
1844 return cs_subset_bool(NeoMutt->sub, "honor_disposition");
1845}
+ Here is the call graph for this function:
+ Here is the caller graph for this function: