1620{
1621 if (!b || !state)
1622 return -1;
1623
1624 bool plaintext = false;
1627 int rc = 0;
1628 static unsigned short recurse_level = 0;
1629
1630 const int oflags = state->
flags;
1632
1634 {
1636 return 1;
1637 }
1638 recurse_level++;
1639
1640
1641
1643 {
1645 state->
flags &= ~STATE_CHARCONV;
1646 }
1648 {
1650 {
1652
1653
1655 {
1657 handler = encrypted_handler;
1658 }
1659 else if (c_reflow_text &&
1661 {
1663 }
1664 else
1665 {
1667 }
1668 }
1671 else
1672 plaintext = false;
1673 }
1675 {
1679 plaintext = true;
1682 }
1684 {
1688 {
1690 }
1691 else if (!
mutt_str_equal(
"inline", c_show_multipart_alternative) &&
1693 {
1695 }
1697 {
1699 mutt_error(
_(
"Error: multipart/signed has no protocol"));
1702 }
1704 {
1706 handler = encrypted_handler;
1707 }
1709 {
1711 handler = encrypted_handler;
1712 }
1713
1714 if (!handler)
1716
1718 {
1722 }
1723 }
1725 {
1727 {
1728
1729 plaintext = true;
1730 }
1732 {
1734 handler = encrypted_handler;
1735 }
1737 {
1739 handler = encrypted_handler;
1740 }
1741 }
1742
1743
1744
1746 {
1747
1748
1751 encrypted_handler && !c_include_encrypted)
1752 {
1753 goto cleanup;
1754 }
1755
1757 }
1758
1759
1761 {
1764
1765 if (!is_attachment_display)
1766 {
1767 char keystroke[128] = { 0 };
1770 {
1772 {
1773
1774 mutt_buffer_printf(&msg,
_(
"[-- This is an attachment (use '%s' to view this part) --]\n"),
1775 keystroke);
1776 }
1777 else
1778 {
1779
1780
1781 mutt_buffer_printf(&msg,
_(
"[-- %s/%s is unsupported (use '%s' to view this part) --]\n"),
1783 }
1784 }
1785 else
1786 {
1788 {
1789 mutt_buffer_strcpy(&msg,
_(
"[-- This is an attachment (need 'view-attachments' bound to key) --]\n"));
1790 }
1791 else
1792 {
1793
1794 mutt_buffer_printf(&msg,
_(
"[-- %s/%s is unsupported (need 'view-attachments' bound to key) --]\n"),
1796 }
1797 }
1798 }
1799 else
1800 {
1802 {
1804 }
1805 else
1806 {
1807
1809 }
1810 }
1814 }
1815
1816cleanup:
1817 recurse_level--;
1819 if (rc != 0)
1820 {
1823 }
1824
1825 return rc;
1826}
struct Buffer mutt_buffer_make(size_t size)
Make a new buffer on the stack.
size_t mutt_buffer_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
void mutt_buffer_dealloc(struct Buffer *buf)
Release the memory allocated by a buffer.
int mutt_buffer_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
static const char * mutt_buffer_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_pgp(struct Body *b)
Does the message use PGP?
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.
bool OptDontHandlePgpKeys
(pseudo) used to extract PGP keys
static int alternative_handler(struct Body *a, struct State *state)
Handler for multipart alternative emails - Implements handler_t -.
int crypt_pgp_application_handler(struct Body *b, struct State *state)
Wrapper for CryptModuleSpecs::application_handler() - Implements handler_t -.
int crypt_smime_application_handler(struct Body *b, struct State *state)
Wrapper for CryptModuleSpecs::application_handler() - Implements handler_t -.
static int multipart_handler(struct Body *a, struct State *state)
Handler for multipart emails - Implements handler_t -.
static int text_plain_handler(struct Body *b, struct State *state)
Handler for plain text - Implements handler_t -.
static int external_body_handler(struct Body *b, struct State *state)
Handler for external-body emails - Implements handler_t -.
static int multilingual_handler(struct Body *a, struct State *state)
Handler for multi-lingual emails - Implements handler_t -.
static int message_handler(struct Body *a, struct State *state)
Handler for message/rfc822 body parts - Implements handler_t -.
int mutt_signed_handler(struct Body *b, struct State *state)
Verify a "multipart/signed" body - Implements handler_t -.
static int malformed_pgp_encrypted_handler(struct Body *b, struct State *state)
Handler for invalid pgp-encrypted emails - Implements handler_t -.
static int autoview_handler(struct Body *a, struct State *state)
Handler for autoviewable attachments - Implements handler_t -.
static int valid_pgp_encrypted_handler(struct Body *b, struct State *state)
Handler for valid pgp-encrypted emails - Implements handler_t -.
int rfc3676_handler(struct Body *a, struct State *state)
Body handler implementing RFC3676 for format=flowed - Implements handler_t -.
int text_enriched_handler(struct Body *a, struct State *state)
Handler for enriched text - 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?
static int run_decode_and_handler(struct Body *b, struct State *state, handler_t handler, bool plaintext)
Run an appropriate decoder for an email.
int(* handler_t)(struct Body *b, struct State *state)
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.
@ LL_DEBUG1
Log at debug level 1.
#define MUTT_MIME_MAX_DEPTH
@ TYPE_MESSAGE
Type: 'message/*'.
@ TYPE_MULTIPART
Type: 'multipart/*'.
@ TYPE_APPLICATION
Type: 'application/*'.
@ TYPE_TEXT
Type: 'text/*'.
@ 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.
#define STATE_DISPLAY
Output is displayed to the user.
#define STATE_DISPLAY_ATTACH
We are displaying an attachment.
#define STATE_FIRSTDONE
The first attachment has been done.
#define STATE_REPLYING
Are we replying?
#define STATE_VERIFY
Perform signature verification.
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 APPLICATION_SMIME
Use SMIME to encrypt/sign.
char * mutt_param_get(const struct ParameterList *pl, const char *s)
Find a matching Parameter.
bool mutt_is_message_type(int type, const char *subtype)
Determine if a mime type matches a message or not.
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.
@ MENU_PAGER
Pager pager (email viewer)