1669{
1670 if (!b || !state)
1671 return -1;
1672
1673 bool plaintext = false;
1676 int rc = 0;
1677 static unsigned short recurse_level = 0;
1678
1679 const int oflags = state->
flags;
1681
1683 {
1685 return 1;
1686 }
1687 recurse_level++;
1688
1689
1690
1692 {
1695 }
1697 {
1699 {
1701
1702
1704 {
1706 handler = encrypted_handler;
1707 }
1708 else if (c_reflow_text &&
1710 {
1712 }
1713 else
1714 {
1716 }
1717 }
1719 {
1721 }
1722 else
1723 {
1724 plaintext = false;
1725 }
1726 }
1728 {
1732 plaintext = true;
1735 }
1737 {
1741 {
1743 }
1744 else if (!
mutt_str_equal(
"inline", c_show_multipart_alternative) &&
1746 {
1748 }
1750 {
1752 mutt_error(
_(
"Error: multipart/signed has no protocol"));
1755 }
1757 {
1759 handler = encrypted_handler;
1760 }
1762 {
1764 handler = encrypted_handler;
1765 }
1766
1767 if (!handler)
1769
1771 {
1775 }
1776 }
1778 {
1780 {
1781
1782 plaintext = true;
1783 }
1785 {
1787 handler = encrypted_handler;
1788 }
1790 {
1792 handler = encrypted_handler;
1793 }
1794 }
1795
1797 {
1798
1799
1800
1801
1804 encrypted_handler && !c_include_encrypted)
1805 {
1806 goto cleanup;
1807 }
1808
1810 }
1812 {
1813
1814
1817
1818 if (is_attachment_display)
1819 {
1821 {
1822 buf_strcpy(msg,
_(
"[-- This is an attachment --]\n"));
1823 }
1824 else
1825 {
1826
1828 }
1829 }
1830 else
1831 {
1835 {
1837 {
1838
1839 buf_printf(msg,
_(
"[-- This is an attachment (use '%s' to view this part) --]\n"),
1841 }
1842 else
1843 {
1844
1845
1846 buf_printf(msg,
_(
"[-- %s/%s is unsupported (use '%s' to view this part) --]\n"),
1848 }
1849 }
1850 else
1851 {
1853 {
1854 buf_strcpy(msg,
_(
"[-- This is an attachment (need 'view-attachments' bound to key) --]\n"));
1855 }
1856 else
1857 {
1858
1859 buf_printf(msg,
_(
"[-- %s/%s is unsupported (need 'view-attachments' bound to key) --]\n"),
1861 }
1862 }
1864 }
1868 }
1869
1870cleanup:
1871 recurse_level--;
1873 if (rc != 0)
1874 {
1877 }
1878
1879 return rc;
1880}
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.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean 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 -.
#define mutt_debug(LEVEL,...)
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.
@ LL_DEBUG1
Log at debug level 1.
#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/*'.
@ TYPE_TEXT
Type: 'text/*'.
#define BODY_TYPE(body)
Get the type name of a body part.
@ DISP_ATTACH
Content is attached.
void state_mark_attach(struct State *state)
Write a unique marker around content.
int state_printf(struct State *state, const char *fmt,...)
Write a formatted string to the State.
@ STATE_CHARCONV
Do character set conversions.
@ STATE_FIRSTDONE
The first attachment has been done.
@ STATE_REPLYING
Are we replying?
@ STATE_VERIFY
Perform signature verification.
@ STATE_DISPLAY_ATTACH
We are displaying an attachment.
@ STATE_DISPLAY
Output is displayed to the user.
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
#define APPLICATION_PGP
Use PGP to encrypt/sign.
#define PGP_ENCRYPT
Email is PGP encrypted.
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
char * mutt_param_get(const struct ParameterList *pl, const char *s)
Find a matching Parameter.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
struct ParameterList parameter
Parameters of the content-type.
unsigned int disposition
content-disposition, ContentDisposition
char * subtype
content-type subtype
unsigned int encoding
content-transfer-encoding, ContentEncoding
unsigned int type
content-type primary type, ContentType
String manipulation buffer.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
StateFlags flags
Flags, e.g. STATE_DISPLAY.