NeoMutt  2021-10-29-225-gb9986f
Teaching an old dog new tricks
DOXYGEN
mime.h
Go to the documentation of this file.
1 
23 #ifndef MUTT_EMAIL_MIME_H
24 #define MUTT_EMAIL_MIME_H
25 
30 {
41 };
42 
47 {
55 };
56 
61 {
66 };
67 
68 /* Some limits to mitigate stack overflow and denial of service attacks */
69 #define MUTT_MIME_MAX_DEPTH 50
70 #define MUTT_MIME_MAX_PARTS 5000
71 
72 
73 /* MIME encoding/decoding global vars */
74 
75 extern const int IndexHex[128];
76 extern const char *const BodyTypes[];
77 extern const char *const BodyEncodings[];
78 extern const char MimeSpecials[];
79 
80 #define hexval(ch) IndexHex[(unsigned int) (ch)]
81 
82 #define is_multipart(body) \
83  (((body)->type == TYPE_MULTIPART) || \
84  (((body)->type == TYPE_MESSAGE) && ((body)->subtype) && \
85  ((strcasecmp((body)->subtype, "rfc822") == 0) || \
86  (strcasecmp((body)->subtype, "news") == 0) || \
87  (strcasecmp((body)->subtype, "global") == 0))))
88 
89 #define TYPE(body) \
90  ((body->type == TYPE_OTHER) && body->xtype ? body->xtype : BodyTypes[(body->type)])
91 
92 #define ENCODING(x) BodyEncodings[(x)]
93 
94 #endif /* MUTT_EMAIL_MIME_H */
ContentEncoding
Content-Transfer-Encoding.
Definition: mime.h:47
@ ENC_7BIT
7-bit text
Definition: mime.h:49
@ ENC_UUENCODED
UUEncoded text.
Definition: mime.h:54
@ ENC_OTHER
Encoding unknown.
Definition: mime.h:48
@ ENC_BINARY
Binary.
Definition: mime.h:53
@ ENC_BASE64
Base-64 encoded text.
Definition: mime.h:52
@ ENC_8BIT
8-bit text
Definition: mime.h:50
@ ENC_QUOTED_PRINTABLE
Quoted-printable text.
Definition: mime.h:51
ContentType
Content-Type.
Definition: mime.h:30
@ TYPE_AUDIO
Type: 'audio/*'.
Definition: mime.h:32
@ TYPE_IMAGE
Type: 'image/*'.
Definition: mime.h:34
@ TYPE_OTHER
Unknown Content-Type.
Definition: mime.h:31
@ TYPE_MESSAGE
Type: 'message/*'.
Definition: mime.h:35
@ TYPE_MODEL
Type: 'model/*'.
Definition: mime.h:36
@ TYPE_MULTIPART
Type: 'multipart/*'.
Definition: mime.h:37
@ TYPE_APPLICATION
Type: 'application/*'.
Definition: mime.h:33
@ TYPE_TEXT
Type: 'text/*'.
Definition: mime.h:38
@ TYPE_ANY
Type: '*' or '.*'.
Definition: mime.h:40
@ TYPE_VIDEO
Type: 'video/*'.
Definition: mime.h:39
ContentDisposition
Content-Disposition values.
Definition: mime.h:61
@ DISP_ATTACH
Content is attached.
Definition: mime.h:63
@ DISP_INLINE
Content is inline.
Definition: mime.h:62
@ DISP_NONE
No preferred disposition.
Definition: mime.h:65
@ DISP_FORM_DATA
Content is form-data.
Definition: mime.h:64
const char MimeSpecials[]
Characters that need special treatment in MIME.
Definition: mime.c:67
const char *const BodyTypes[]
Common MIME body types.
Definition: mime.c:51
const int IndexHex[128]
Lookup table for ASCII hex digits.
Definition: mime.c:35
const char *const BodyEncodings[]
Common MIME body encodings.
Definition: mime.c:59