1665{
1666 if (!b || !state)
1667 return -1;
1668
1669 bool plaintext = false;
1672 int rc = 0;
1673 static unsigned short recurse_level = 0;
1674
1675 const int oflags = state->
flags;
1677
1679 {
1681 return 1;
1682 }
1683 recurse_level++;
1684
1685
1686
1688 {
1691 }
1693 {
1695 {
1697
1698
1700 {
1702 handler = encrypted_handler;
1703 }
1704 else if (c_reflow_text &&
1706 {
1708 }
1709 else
1710 {
1712 }
1713 }
1715 {
1717 }
1718 else
1719 {
1720 plaintext = false;
1721 }
1722 }
1724 {
1728 plaintext = true;
1731 }
1733 {
1737 {
1739 }
1740 else if (!
mutt_str_equal(
"inline", c_show_multipart_alternative) &&
1742 {
1744 }
1746 {
1748 mutt_error(
_(
"Error: multipart/signed has no protocol"));
1751 }
1753 {
1755 handler = encrypted_handler;
1756 }
1758 {
1760 handler = encrypted_handler;
1761 }
1762
1763 if (!handler)
1765
1767 {
1771 }
1772 }
1774 {
1776 {
1777
1778 plaintext = true;
1779 }
1781 {
1783 handler = encrypted_handler;
1784 }
1786 {
1788 handler = encrypted_handler;
1789 }
1790 }
1791
1793 {
1794
1795
1796
1797
1800 encrypted_handler && !c_include_encrypted)
1801 {
1802 goto cleanup;
1803 }
1804
1806 }
1808 {
1809
1810
1813
1814 if (is_attachment_display)
1815 {
1817 {
1818 buf_strcpy(msg,
_(
"[-- This is an attachment --]\n"));
1819 }
1820 else
1821 {
1822
1824 }
1825 }
1826 else
1827 {
1830 {
1832 {
1833
1834 buf_printf(msg,
_(
"[-- This is an attachment (use '%s' to view this part) --]\n"),
1836 }
1837 else
1838 {
1839
1840
1841 buf_printf(msg,
_(
"[-- %s/%s is unsupported (use '%s' to view this part) --]\n"),
1843 }
1844 }
1845 else
1846 {
1848 {
1849 buf_strcpy(msg,
_(
"[-- This is an attachment (need 'view-attachments' bound to key) --]\n"));
1850 }
1851 else
1852 {
1853
1854 buf_printf(msg,
_(
"[-- %s/%s is unsupported (need 'view-attachments' bound to key) --]\n"),
1856 }
1857 }
1859 }
1863 }
1864
1865cleanup:
1866 recurse_level--;
1868 if (rc != 0)
1869 {
1872 }
1873
1874 return rc;
1875}
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.
bool keymap_expand_key(struct Keymap *km, struct Buffer *buf)
Get the key string bound to a Keymap.
#define MUTT_MIME_MAX_DEPTH
Maximum nesting depth for MIME parts to prevent stack overflow.
@ 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 STATE_CHARCONV
Do character set conversions.
#define APPLICATION_PGP
Use PGP to encrypt/sign.
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
unsigned int disposition
content-disposition, ContentDisposition