Browse code

More bounces handled

git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@423 77e5149b-7576-45b1-b177-96237e5ba77b

Nigel Horne authored on 2004/03/20 22:24:43
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Sat Mar 20 13:33:49 GMT 2004 (njh)
2
+----------------------------------
3
+  * libclamav/message.c:	More bounces added
4
+
1 5
 Sat Mar 20 12:40:15 GMT 2004 (njh)
2 6
 ----------------------------------
3 7
   * clamav-milter: strerror_r is a bit confused on Fedora Linux. The man page
... ...
@@ -17,6 +17,9 @@
17 17
  *
18 18
  * Change History:
19 19
  * $Log: message.c,v $
20
+ * Revision 1.43  2004/03/20 13:23:44  nigelhorne
21
+ * More bounces handled
22
+ *
20 23
  * Revision 1.42  2004/03/19 17:38:11  nigelhorne
21 24
  * Handle binary encoding as though it had no encoding
22 25
  *
... ...
@@ -123,7 +126,7 @@
123 123
  * uuencodebegin() no longer static
124 124
  *
125 125
  */
126
-static	char	const	rcsid[] = "$Id: message.c,v 1.42 2004/03/19 17:38:11 nigelhorne Exp $";
126
+static	char	const	rcsid[] = "$Id: message.c,v 1.43 2004/03/20 13:23:44 nigelhorne Exp $";
127 127
 
128 128
 #if HAVE_CONFIG_H
129 129
 #include "clamav-config.h"
... ...
@@ -208,22 +211,27 @@ static	struct	mime_map {
208 208
 };
209 209
 
210 210
 /*
211
- * TODO: remove this table and scan all *efficiently* for bounce messages
211
+ * TODO: remove this table and scan all *efficiently* for bounce messages,
212
+ * probably using cl_magic[] from scanners.c
212 213
  */
213 214
 static const char *bounces[] = {
214
-	"--- Below this line is a copy of the message.",
215
-	"------ This is a copy of the message, including all the headers. ------",
216 215
 	"=================================================================================",
217
-	"------- The original message sent:",
218
-	"   ----- Original message follows -----",
219
-	"------- Original mail message ----",
220 216
 	"------ A continuacion adjuntamos copia del mensaje, incluyendo las cabeceras. ------",
221
-	"------- Returned Message --------",
222
-	"--- Below this line is the original bounce.",
223 217
 	"A copy of the original message below this line:",
224 218
 	"==== Begin Message",
219
+	"--- Below this line is a copy of the message.",
220
+	"--- Below this line is the original bounce.",
221
+	"|----------- Message text follows: (body too large, truncated) ----------|",
222
+	"[ Offending message ]",
223
+	"------- Original mail message ----",
225 224
 	"------------------------------ Original message ------------------------------",
225
+	"   ----- Original message follows -----",
226 226
 	"Original message follows:",
227
+	"--- Returned Message ---",
228
+	"------- Returned Message --------",
229
+	"------- The original message sent:",
230
+	"------ This is a copy of the message, including all the headers. ------",
231
+	" --------Unsent Message below:",
227 232
 	NULL
228 233
 };
229 234
 
... ...
@@ -1057,8 +1065,6 @@ messageToText(const message *m)
1057 1057
 		 * Fast copy
1058 1058
 		 */
1059 1059
 		for(t_line = messageGetBody(m); t_line; t_line = t_line->t_next) {
1060
-			/*const char *line;*/
1061
-
1062 1060
 			if(first == NULL)
1063 1061
 				first = last = cli_malloc(sizeof(text));
1064 1062
 			else {
... ...
@@ -1066,14 +1072,8 @@ messageToText(const message *m)
1066 1066
 				last = last->t_next;
1067 1067
 			}
1068 1068
 
1069
-			/*line = t_line->t_text;
1070
-
1071
-			last->t_text = cli_malloc(strlen(line) + 2);
1072
-
1073
-			assert(last->t_text != NULL);
1074
-
1075
-			sprintf(last->t_text, "%s\n", line);*/
1076
-			if((last->t_text = strdup(t_line->t_text)) == NULL) {
1069
+			if((last == NULL) ||
1070
+			   ((last->t_text = strdup(t_line->t_text)) == NULL)) {
1077 1071
 				textDestroy(first);
1078 1072
 				return NULL;
1079 1073
 			}