summaryrefslogtreecommitdiffabout
path: root/kmicromail/libetpan/imf/mailimf.c
Unidiff
Diffstat (limited to 'kmicromail/libetpan/imf/mailimf.c') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/libetpan/imf/mailimf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kmicromail/libetpan/imf/mailimf.c b/kmicromail/libetpan/imf/mailimf.c
index 84d81a1..e0164b8 100644
--- a/kmicromail/libetpan/imf/mailimf.c
+++ b/kmicromail/libetpan/imf/mailimf.c
@@ -3,97 +3,97 @@
3 * 3 *
4 * Copyright (C) 2001, 2002 - DINH Viet Hoa 4 * Copyright (C) 2001, 2002 - DINH Viet Hoa
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
15 * 3. Neither the name of the libEtPan! project nor the names of its 15 * 3. Neither the name of the libEtPan! project nor the names of its
16 * contributors may be used to endorse or promote products derived 16 * contributors may be used to endorse or promote products derived
17 * from this software without specific prior written permission. 17 * from this software without specific prior written permission.
18 * 18 *
19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29 * SUCH DAMAGE. 29 * SUCH DAMAGE.
30 */ 30 */
31 31
32/* 32/*
33 * $Id$ 33 * $Id$
34 */ 34 */
35 35
36#include "mailimf.h" 36#include "mailimf.h"
37 37
38/* 38/*
39 RFC 2822 39 RFC 2822
40 40
41 RFC 2821 ... 41 RFC 2821 ...
42 A message-originating SMTP system SHOULD NOT send a message that 42 A message-originating SMTP system SHOULD NOT send a message that
43 already contains a Return-path header. SMTP servers performing a 43 already contains a Return-path header. SMTP servers performing a
44 relay function MUST NOT inspect the message data, and especially not 44 relay function MUST NOT inspect the message data, and especially not
45 to the extent needed to determine if Return-path headers are present. 45 to the extent needed to determine if Return-path headers are present.
46 SMTP servers making final delivery MAY remove Return-path headers 46 SMTP servers making final delivery MAY remove Return-path headers
47 before adding their own. 47 before adding their own.
48*/ 48*/
49 49
50#include <ctype.h> 50#include <ctype.h>
51#include <mmapstring.h> 51#include "mmapstring.h"
52#include <stdlib.h> 52#include <stdlib.h>
53#include <string.h> 53#include <string.h>
54 54
55#ifndef TRUE 55#ifndef TRUE
56#define TRUE 1 56#define TRUE 1
57#endif 57#endif
58 58
59#ifndef FALSE 59#ifndef FALSE
60#define FALSE 0 60#define FALSE 0
61#endif 61#endif
62 62
63 63
64 64
65 65
66 66
67 67
68 68
69static inline int is_dtext(char ch); 69static inline int is_dtext(char ch);
70 70
71static int mailimf_quoted_pair_parse(const char * message, size_t length, 71static int mailimf_quoted_pair_parse(const char * message, size_t length,
72 size_t * index, char * result); 72 size_t * index, char * result);
73 73
74static int mailimf_ccontent_parse(const char * message, size_t length, 74static int mailimf_ccontent_parse(const char * message, size_t length,
75 size_t * index); 75 size_t * index);
76 76
77static int 77static int
78mailimf_comment_fws_ccontent_parse(const char * message, size_t length, 78mailimf_comment_fws_ccontent_parse(const char * message, size_t length,
79 size_t * index); 79 size_t * index);
80 80
81static inline int mailimf_comment_parse(const char * message, size_t length, 81static inline int mailimf_comment_parse(const char * message, size_t length,
82 size_t * index); 82 size_t * index);
83 83
84static int mailimf_qcontent_parse(const char * message, size_t length, 84static int mailimf_qcontent_parse(const char * message, size_t length,
85 size_t * index, char * ch); 85 size_t * index, char * ch);
86 86
87static int mailimf_phrase_parse(const char * message, size_t length, 87static int mailimf_phrase_parse(const char * message, size_t length,
88 size_t * index, char ** result); 88 size_t * index, char ** result);
89 89
90static int mailimf_unstructured_parse(const char * message, size_t length, 90static int mailimf_unstructured_parse(const char * message, size_t length,
91 size_t * index, char ** result); 91 size_t * index, char ** result);
92 92
93static int mailimf_ignore_unstructured_parse(const char * message, size_t length, 93static int mailimf_ignore_unstructured_parse(const char * message, size_t length,
94 size_t * index); 94 size_t * index);
95 95
96static int mailimf_day_of_week_parse(const char * message, size_t length, 96static int mailimf_day_of_week_parse(const char * message, size_t length,
97 size_t * index, int * result); 97 size_t * index, int * result);
98 98
99static int mailimf_day_name_parse(const char * message, size_t length, 99static int mailimf_day_name_parse(const char * message, size_t length,