1597{
1598 if (!b || !s)
1599 return -1;
1600
1601 bool plaintext = false;
1604 int rc = 0;
1605 static unsigned short recurse_level = 0;
1606
1607 const int oflags = s->
flags;
1609
1611 {
1613 return 1;
1614 }
1615 recurse_level++;
1616
1617
1618
1620 {
1622 s->
flags &= ~MUTT_CHARCONV;
1623 }
1625 {
1627 {
1629
1630
1632 {
1634 handler = encrypted_handler;
1635 }
1636 else if (c_reflow_text &&
1638 {
1640 }
1641 else
1642 {
1644 }
1645 }
1648 else
1649 plaintext = false;
1650 }
1652 {
1656 plaintext = true;
1659 }
1661 {
1665 {
1667 }
1668 else if (!
mutt_str_equal(
"inline", c_show_multipart_alternative) &&
1670 {
1672 }
1674 {
1676 mutt_error(
_(
"Error: multipart/signed has no protocol"));
1679 }
1681 {
1683 handler = encrypted_handler;
1684 }
1686 {
1688 handler = encrypted_handler;
1689 }
1690
1691 if (!handler)
1693
1695 {
1699 }
1700 }
1702 {
1704 {
1705
1706 plaintext = true;
1707 }
1709 {
1711 handler = encrypted_handler;
1712 }
1714 {
1716 handler = encrypted_handler;
1717 }
1718 }
1719
1720
1721
1723 {
1724
1725
1728 encrypted_handler && !c_include_encrypted)
1729 {
1730 goto cleanup;
1731 }
1732
1734 }
1735
1736
1738 {
1741
1742 if (!is_attachment_display)
1743 {
1744 char keystroke[128] = { 0 };
1747 {
1749 {
1750
1751 mutt_buffer_printf(&msg,
_(
"[-- This is an attachment (use '%s' to view this part) --]\n"),
1752 keystroke);
1753 }
1754 else
1755 {
1756
1757
1758 mutt_buffer_printf(&msg,
_(
"[-- %s/%s is unsupported (use '%s' to view this part) --]\n"),
1760 }
1761 }
1762 else
1763 {
1765 {
1766 mutt_buffer_strcpy(&msg,
_(
"[-- This is an attachment (need 'view-attachments' bound to key) --]\n"));
1767 }
1768 else
1769 {
1770
1771 mutt_buffer_printf(&msg,
_(
"[-- %s/%s is unsupported (need 'view-attachments' bound to key) --]\n"),
1773 }
1774 }
1775 }
1776 else
1777 {
1779 {
1781 }
1782 else
1783 {
1784
1786 }
1787 }
1791 }
1792
1793cleanup:
1794 recurse_level--;
1796 if (rc != 0)
1797 {
1800 }
1801
1802 return rc;
1803}
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.
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string 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.
static int multipart_handler(struct Body *a, struct State *s)
Handler for multipart emails - Implements handler_t -.
static int message_handler(struct Body *a, struct State *s)
Handler for message/rfc822 body parts - Implements handler_t -.
static int malformed_pgp_encrypted_handler(struct Body *b, struct State *s)
Handler for invalid pgp-encrypted emails - Implements handler_t -.
int rfc3676_handler(struct Body *a, struct State *s)
Body handler implementing RFC3676 for format=flowed - Implements handler_t -.
int mutt_signed_handler(struct Body *b, struct State *s)
Verify a "multipart/signed" body - Implements handler_t -.
static int autoview_handler(struct Body *a, struct State *s)
Handler for autoviewable attachments - Implements handler_t -.
static int text_plain_handler(struct Body *b, struct State *s)
Handler for plain text - Implements handler_t -.
int text_enriched_handler(struct Body *a, struct State *s)
Handler for enriched text - Implements handler_t -.
static int multilingual_handler(struct Body *a, struct State *s)
Handler for multi-lingual emails - Implements handler_t -.
static int alternative_handler(struct Body *a, struct State *s)
Handler for multipart alternative emails - Implements handler_t -.
static int valid_pgp_encrypted_handler(struct Body *b, struct State *s)
Handler for valid pgp-encrypted emails - Implements handler_t -.
static int external_body_handler(struct Body *b, struct State *s)
Handler for external-body emails - Implements handler_t -.
int crypt_smime_application_handler(struct Body *b, struct State *s)
Wrapper for CryptModuleSpecs::application_handler() - Implements handler_t -.
int crypt_pgp_application_handler(struct Body *b, struct State *s)
Wrapper for CryptModuleSpecs::application_handler() - Implements handler_t -.
int(* handler_t)(struct Body *b, struct State *s)
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 *s, 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 MUTT_VERIFY
Perform signature verification.
#define MUTT_DISPLAY
Output is displayed to the user.
#define MUTT_DISPLAY_ATTACH
We are displaying an attachment.
#define MUTT_REPLYING
Are we replying?
#define APPLICATION_PGP
Use PGP to encrypt/sign.
#define APPLICATION_SMIME
Use SMIME to encrypt/sign.
bool OptDontHandlePgpKeys
(pseudo) used to extract PGP keys
bool mutt_is_message_type(int type, const char *subtype)
Determine if a mime type matches a message or not.
unsigned int disposition
content-disposition, ContentDisposition
@ MENU_PAGER
Pager pager (email viewer)