Consolidate base64 encode/decode routines.
[exim.git] / src / src / mime.h
CommitLineData
8523533c
TK
1/*************************************************
2* Exim - an Internet mail transport agent *
3*************************************************/
4
3386088d 5/* Copyright (c) Tom Kistner <tom@duncanthrax.net> 2004, 2015 */
8523533c
TK
6/* License: GPL */
7
8#ifdef WITH_CONTENT_SCAN
9
10#define MIME_MAX_HEADER_SIZE 8192
11#define MIME_MAX_LINE_LENGTH 32768
12
13#define MBC_ATTACHMENT 0
14#define MBC_COVERLETTER_ONESHOT 1
15#define MBC_COVERLETTER_ALL 2
16
17struct mime_boundary_context
18{
19 struct mime_boundary_context *parent;
20 unsigned char *boundary;
21 int context;
22};
23
24typedef struct mime_header {
f846c8f5
JH
25 uschar * name;
26 int namelen;
27 uschar ** value;
8523533c
TK
28} mime_header;
29
30static mime_header mime_header_list[] = {
f846c8f5
JH
31 { US"content-type:", 13, &mime_content_type },
32 { US"content-disposition:", 20, &mime_content_disposition },
8523533c 33 { US"content-transfer-encoding:", 26, &mime_content_transfer_encoding },
f846c8f5
JH
34 { US"content-id:", 11, &mime_content_id },
35 { US"content-description:", 20, &mime_content_description }
8523533c
TK
36};
37
38static int mime_header_list_size = sizeof(mime_header_list)/sizeof(mime_header);
39
40
41
42typedef struct mime_parameter {
93cad488
JH
43 uschar * name;
44 int namelen;
45 uschar ** value;
8523533c
TK
46} mime_parameter;
47
48static mime_parameter mime_parameter_list[] = {
93cad488 49 { US"name=", 5, &mime_filename },
8523533c 50 { US"filename=", 9, &mime_filename },
f846c8f5 51 { US"charset=", 8, &mime_charset },
8523533c
TK
52 { US"boundary=", 9, &mime_boundary }
53};
54
8523533c
TK
55
56/* MIME Anomaly list */
f4d091fb
JH
57#define MIME_ANOMALY_BROKEN_BASE64 1
58#define MIME_ANOMALY_BROKEN_QP 0
59
8523533c
TK
60
61#endif