1632{
1633 if (!b || !state)
1634 return -1;
1635
1636 bool plaintext = false;
1639 int rc = 0;
1640 static unsigned short recurse_level = 0;
1641
1642 const int oflags = state->
flags;
1644
1646 {
1648 return 1;
1649 }
1650 recurse_level++;
1651
1652
1653
1655 {
1657 state->
flags &= ~STATE_CHARCONV;
1658 }
1660 {
1662 {
1664
1665
1667 {
1669 handler = encrypted_handler;
1670 }
1671 else if (c_reflow_text &&
1673 {
1675 }
1676 else
1677 {
1679 }
1680 }
1682 {
1684 }
1685 else
1686 {
1687 plaintext = false;
1688 }
1689 }
1691 {
1695 plaintext = true;
1698 }
1700 {
1704 {
1706 }
1707 else if (!
mutt_str_equal(
"inline", c_show_multipart_alternative) &&
1709 {
1711 }
1713 {
1715 mutt_error(
_(
"Error: multipart/signed has no protocol"));
1718 }
1720 {
1722 handler = encrypted_handler;
1723 }
1725 {
1727 handler = encrypted_handler;
1728 }
1729
1730 if (!handler)
1732
1734 {
1738 }
1739 }
1741 {
1743 {
1744
1745 plaintext = true;
1746 }
1748 {
1750 handler = encrypted_handler;
1751 }
1753 {
1755 handler = encrypted_handler;
1756 }
1757 }
1758
1760 {
1761
1762
1763
1764
1767 encrypted_handler && !c_include_encrypted)
1768 {
1769 goto cleanup;
1770 }
1771
1773 }
1775 {
1776
1777
1780
1781 if (is_attachment_display)
1782 {
1784 {
1785 buf_strcpy(msg,
_(
"[-- This is an attachment --]\n"));
1786 }
1787 else
1788 {
1789
1791 }
1792 }
1793 else
1794 {
1795 char keystroke[128] = { 0 };
1798 {
1800 {
1801
1802 buf_printf(msg,
_(
"[-- This is an attachment (use '%s' to view this part) --]\n"),
1803 keystroke);
1804 }
1805 else
1806 {
1807
1808
1809 buf_printf(msg,
_(
"[-- %s/%s is unsupported (use '%s' to view this part) --]\n"),
1811 }
1812 }
1813 else
1814 {
1816 {
1817 buf_strcpy(msg,
_(
"[-- This is an attachment (need 'view-attachments' bound to key) --]\n"));
1818 }
1819 else
1820 {
1821
1822 buf_printf(msg,
_(
"[-- %s/%s is unsupported (need 'view-attachments' bound to key) --]\n"),
1824 }
1825 }
1826 }
1830 }
1831
1832cleanup:
1833 recurse_level--;
1835 if (rc != 0)
1836 {
1839 }
1840
1841 return rc;
1842}
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
SecurityFlags mutt_is_application_smime(struct Body *b)
Does the message use S/MIME?
int mutt_is_valid_multipart_pgp_encrypted(struct Body *b)
Is this a valid multi-part encrypted message?
SecurityFlags mutt_is_malformed_multipart_pgp_encrypted(struct Body *b)
Check for malformed layout.
SecurityFlags mutt_is_application_pgp(const struct Body *b)
Does the message use PGP?
bool mutt_is_message_type(int type, const char *subtype)
Determine if a mime type matches a message or not.
bool OptDontHandlePgpKeys
(pseudo) used to extract PGP keys
int crypt_pgp_application_handler(struct Body *b_email, struct State *state)
Wrapper for CryptModuleSpecs::application_handler() - Implements handler_t -.
static int alternative_handler(struct Body *b_email, struct State *state)
Handler for multipart alternative emails - Implements handler_t -.
int text_enriched_handler(struct Body *b_email, struct State *state)
Handler for enriched text - Implements handler_t -.
static int text_plain_handler(struct Body *b_email, struct State *state)
Handler for plain text - Implements handler_t -.
int crypt_smime_application_handler(struct Body *b_email, struct State *state)
Wrapper for CryptModuleSpecs::application_handler() - Implements handler_t -.
static int autoview_handler(struct Body *b_email, struct State *state)
Handler for autoviewable attachments - Implements handler_t -.
static int external_body_handler(struct Body *b_email, struct State *state)
Handler for external-body emails - Implements handler_t -.
int rfc3676_handler(struct Body *b_email, struct State *state)
Handler for format=flowed - Implements handler_t -.
static int malformed_pgp_encrypted_handler(struct Body *b_email, struct State *state)
Handler for invalid pgp-encrypted emails - Implements handler_t -.
static int valid_pgp_encrypted_handler(struct Body *b_email, struct State *state)
Handler for valid pgp-encrypted emails - Implements handler_t -.
static int message_handler(struct Body *b_email, struct State *state)
Handler for message/rfc822 body parts - Implements handler_t -.
static int multipart_handler(struct Body *b_email, struct State *state)
Handler for multipart emails - Implements handler_t -.
static int multilingual_handler(struct Body *b_email, struct State *state)
Handler for multi-lingual emails - Implements handler_t -.
int mutt_signed_handler(struct Body *b_email, struct State *state)
Handler for "multipart/signed" - Implements handler_t -.
static bool is_autoview(struct Body *b)
Should email body be filtered by mailcap.
bool mutt_prefer_as_attachment(struct Body *b)
Do we want this part as an attachment?
int(* handler_t)(struct Body *b_email, struct State *state)
static int run_decode_and_handler(struct Body *b, struct State *state, handler_t handler, bool plaintext)
Run an appropriate decoder for an email.
struct Keymap * km_find_func(enum MenuType mtype, int func)
Find a function's mapping in a Menu.
int km_expand_key(char *s, size_t len, struct Keymap *map)
Get the key string bound to a Keymap.
#define MUTT_MIME_MAX_DEPTH
@ TYPE_MESSAGE
Type: 'message/*'.
@ TYPE_MULTIPART
Type: 'multipart/*'.
@ TYPE_APPLICATION
Type: 'application/*'.
@ DISP_ATTACH
Content is attached.
#define STATE_DISPLAY
Output is displayed to the user.
#define STATE_DISPLAY_ATTACH
We are displaying an attachment.
#define STATE_REPLYING
Are we replying?
#define STATE_VERIFY
Perform signature verification.
#define APPLICATION_PGP
Use PGP to encrypt/sign.
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
unsigned int disposition
content-disposition, ContentDisposition
@ MENU_PAGER
Pager pager (email viewer)