File: remove-tnef

package info (click to toggle)
ripmime 1.4.0.10.debian.1-3
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 1,428 kB
  • sloc: ansic: 8,775; makefile: 59; sh: 37
file content (297 lines) | stat: -rw-r--r-- 9,842 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
Index: ripmime-1.4.0.10.debian.1/Makefile
===================================================================
--- ripmime-1.4.0.10.debian.1.orig/Makefile
+++ ripmime-1.4.0.10.debian.1/Makefile
@@ -34,9 +34,9 @@ LIBS=
 OBJ=ripmime 
 RIPOLE_OBJS= ripOLE/ole.o ripOLE/olestream-unwrap.o ripOLE/bytedecoders.o  ripOLE/bt-int.o
 #RIPOLE_OBJS=
-OFILES= strstack.o mime.o ffget.o MIME_headers.o tnef/tnef.o rawget.o pldstr.o logger.o libmime-decoders.o boundary-stack.o uuencode.o filename-filters.o $(RIPOLE_OBJS)
+OFILES= strstack.o mime.o ffget.o MIME_headers.o rawget.o pldstr.o logger.o libmime-decoders.o boundary-stack.o uuencode.o filename-filters.o $(RIPOLE_OBJS)
 
-default: tnef/tnef.o ripmime ripOLE/ole.o
+default: ripmime ripOLE/ole.o
 
 buildcodes.h: 
 	./generate-buildcodes.sh
@@ -44,9 +44,6 @@ buildcodes.h:
 ripOLE/ole.o:
 	./build_ripOLE
 
-tnef/tnef.o:
-	./build_tnef
-
 .c.o:
 	${CC} ${CFLAGS} $(COMPONENTS) -c $*.c
 
Index: ripmime-1.4.0.10.debian.1/mime.c
===================================================================
--- ripmime-1.4.0.10.debian.1.orig/mime.c
+++ ripmime-1.4.0.10.debian.1/mime.c
@@ -47,7 +47,6 @@
 #include "boundary-stack.h"
 #include "ffget.h"
 #include "mime.h"
-#include "tnef/tnef_api.h"
 #include "ripOLE/ole.h"
 #include "libmime-decoders.h"
 #include "uuencode.h"
@@ -156,7 +155,6 @@ struct MIME_globals {
 	char out_charset[MDECODE_ISO_CHARSET_SIZE_MAX];
 
 	int decode_uu;
-	int decode_tnef;
 	int decode_b64;
 	int decode_qp;
 	int decode_mht;
@@ -279,7 +277,6 @@ int MIME_set_debug( int level )
 	glb.debug = level;
 
 	BS_set_debug(level);
-	TNEF_set_debug(level);
 	MIMEH_set_debug(level);
 	MDECODE_set_debug(level);
 	UUENCODE_set_debug(level);
@@ -334,31 +331,6 @@ int MIME_set_recursion_level( int level
 	return glb.max_recursion_level;
 }
 
-/*-----------------------------------------------------------------\
-  Function Name	: MIME_set_decode_tnef
-  Returns Type	: int
-  ----Parameter List
-  1. int level , 
-  ------------------
-  Exit Codes	: 
-  Side Effects	: 
-  --------------------------------------------------------------------
-Comments:
-
---------------------------------------------------------------------
-Changes:
-
-\------------------------------------------------------------------*/
-int MIME_set_decode_tnef( int level )
-{
-	glb.decode_tnef = level;
-
-	TNEF_set_decode( level );
-
-
-	return level;
-}
-
 
 /*-----------------------------------------------------------------\
   Function Name	: MIME_set_decode_ole
@@ -581,7 +553,6 @@ int MIME_set_verbosity( int level )
 	glb.verbosity = level;
 
 	MIMEH_set_verbosity( level );
-	TNEF_set_verbosity( level );
 	FNFILTER_set_verbose( level );
 	UUENCODE_set_verbosity( level );
 	MDECODE_set_verbose( level );
@@ -637,7 +608,6 @@ int MIME_set_verbosity_contenttype( int
 	glb.verbosity_contenttype = level;
 	MIMEH_set_verbosity_contenttype( level );
 	UUENCODE_set_verbosity_contenttype( level );
-	TNEF_set_verbosity_contenttype( level );
 
 	return glb.verbosity_contenttype;
 }
@@ -709,7 +679,6 @@ int MIME_set_filename_report_fn( int (*p
 {
 	glb.filename_decoded_reporter = ptr_to_fn;
 	UUENCODE_set_filename_report_fn( ptr_to_fn );
-	TNEF_set_filename_report_fn( ptr_to_fn );
 
 	return 0;
 }
@@ -1227,35 +1196,6 @@ int MIME_getchar_start( FFGET_FILE *f )
 
 
 
-/*------------------------------------------------------------------------
-Procedure:     MIME_decode_TNEF ID:1
-Purpose:       Decodes TNEF encoded attachments
-Input:
-Output:
-Errors:
-------------------------------------------------------------------------*/
-int MIME_decode_TNEF( char *unpackdir, struct MIMEH_header_info *hinfo, int keep )
-{
-	int result=0;
-	char fullpath[1024];
-
-	snprintf(fullpath,sizeof(fullpath),"%s/%s",unpackdir,hinfo->filename);
-
-	TNEF_set_path(unpackdir);
-
-	result = TNEF_main( fullpath );
-
-	if (result >= 0)
-	{
-		//		result = remove( fullpath );
-		if (result == -1)
-		{
-			if (MIME_VERBOSE) LOGGER_log("%s:%d:MIME_decode_TNEF: Removing %s failed (%s)",FL,fullpath,strerror(errno));
-		}
-	}
-
-	return result;
-}
 
 
 #ifdef RIPOLE
@@ -1424,16 +1364,6 @@ int MIME_decode_raw( FFGET_FILE *f, char
 
 		glb.attachment_count += result;
 
-		if (strlen(hinfo->uudec_name))
-		{
-			if (strcasecmp(hinfo->uudec_name,"winmail.dat")==0)
-			{
-				if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_raw:DEBUG: Decoding TNEF format\n",FL);
-				snprintf(hinfo->filename, 128, "%s", hinfo->uudec_name);
-				MIME_decode_TNEF( unpackdir, hinfo, keep);
-			}
-			else LOGGER_log("%s:%d:MIME_decode_raw:WARNING: hinfo has been clobbered.\n",FL);
-		}
 	}
 
 	if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_raw:DEBUG: End[result = %d]\n",FL,result);
@@ -1620,13 +1550,6 @@ int MIME_decode_text( FFGET_FILE *f, cha
 		if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_text:DEBUG: hinfo = %p\n",FL,hinfo);
 		if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_text:DEBUG: Done. [ UUName = '%s' ]\n",FL,hinfo->uudec_name);
 
-		if (strncasecmp(hinfo->uudec_name,"winmail.dat",11)==0)
-		{
-			if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_text:DEBUG: Decoding TNEF format\n",FL);
-			snprintf(hinfo->filename, 128, "%s", hinfo->uudec_name);
-			MIME_decode_TNEF( unpackdir, hinfo, keep );
-		}
-
 		if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_text:DEBUG: Completed decoding UUencoded data.\n",FL);
 	}
 
@@ -2317,7 +2240,6 @@ int MIME_init( void )
 	UUENCODE_init();	// uuen:coding decoding initialisations
 	FNFILTER_init();	// Filename filtering
 	MDECODE_init();	// ISO filename decoding initialisation
-	TNEF_init();		// TNEF decoder
 
 
 	glb.header_defect_count = 0;
@@ -2342,7 +2264,6 @@ int MIME_init( void )
 
 	glb.decode_qp = 1;
 	glb.decode_b64 = 1;
-	glb.decode_tnef = 1;
 	glb.decode_ole = 1;
 	glb.decode_uu = 1;
 	glb.decode_mht = 1;
@@ -2746,19 +2667,6 @@ int MIME_decode_encoding( FFGET_FILE *f,
 
 
 
-		// If our content-type was TNEF, then we need to decode it 
-		//		using an external decoding engine (see tnef/tnef.c)
-		// Admittingly, this is not the most ideal way of picking out
-		//		TNEF files from our decoded attachments, but, for now
-		//		it'll have to do, besides, it does work fine, without any
-		//		side-effects
-
-		if (hinfo->content_type == _CTYPE_TNEF)
-		{
-			if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: Decoding TNEF format\n",FL);
-			glb.attachment_count++;
-			MIME_decode_TNEF( unpackdir, hinfo, 0 );
-		} // Decode TNEF
 
 
 
Index: ripmime-1.4.0.10.debian.1/mime.h
===================================================================
--- ripmime-1.4.0.10.debian.1.orig/mime.h
+++ ripmime-1.4.0.10.debian.1/mime.h
@@ -74,7 +74,6 @@ int MIME_set_dumpheaders( int level );
 int MIME_set_headersname( char *fname );
 
 int MIME_set_decode_uudecode( int level );
-int MIME_set_decode_tnef( int level );
 int MIME_set_decode_ole( int level );
 int MIME_set_decode_qp( int level );
 int MIME_set_decode_base64( int level );
Index: ripmime-1.4.0.10.debian.1/ripmime.1
===================================================================
--- ripmime-1.4.0.10.debian.1.orig/ripmime.1
+++ ripmime-1.4.0.10.debian.1/ripmime.1
@@ -15,7 +15,7 @@ ripMIME \-i <mime file> \-d <directory>
 .br 
 [\-\-unique_names[\-\-prefix|\-\-postfix|\-\-infix]] [\-\-mailbox]
 .br 
-[\-\-no\-tnef] [\-\-no\-quotedprintable] [\-\-no\-uudecode] [\-\-no\-ole] [\-\-no\-doublecr] [\-\-no\-mht]
+[\-\-no\-quotedprintable] [\-\-no\-uudecode] [\-\-no\-ole] [\-\-no\-doublecr] [\-\-no\-mht]
 .br 
 [\-\-disable\-qmail\-bounce] [\-\-recursion\-max <level>]
 .br 
@@ -107,9 +107,6 @@ Produces detailed information about the
 
 .SS "Attachment type decoding switches"
 .TP 
-\-\-no\-tnef
-Turn off TNEF/winmail.dat decoding
-.TP 
 \-\-no\-ole
 Turn off OLE decoding
 .TP 
@@ -130,7 +127,8 @@ Turns off ripMIME's look\-ahead searchin
 .TP 
 \-\-no\-multiple\-filenames
 Turns off the behaviour of handling multiple filename occurances in a single MIME header. Normally ripMIME will generate a hard link for each additional filename beyond the original attachment filename detected.
-
+.TP
+Note that this Debian version does not include the \-\-no\-tnef switch.  The tnef package may be useful as an alternative.
 .SS Auxillary parameters
 .TP 
 \-\-buildcodes
@@ -166,4 +164,5 @@ For mailpacks which do not appear to dec
 .BR altermime (1),
 .BR inflex (1),
 .BR ripole (1),
-.BR opentnef (1)
+.BR opentnef (1),
+.BR tnef (1)
Index: ripmime-1.4.0.10.debian.1/ripmime.c
===================================================================
--- ripmime-1.4.0.10.debian.1.orig/ripmime.c
+++ ripmime-1.4.0.10.debian.1/ripmime.c
@@ -58,7 +58,7 @@ char help[] = "ripMIME -i <mime file> -d
 	"[-p prefix] [-e [header file]] [-vVh] [--version]"
 	"[--no_nameless] [--unique_names [--prefix|--postfix|--infix]]"
 	"[--paranoid] [--mailbox] [--formdata] [--debug]"
-	"[--no-tnef] [--no-quotedprintable] [--no-uudecode]\n"
+	"[--no-quotedprintable] [--no-uudecode]\n"
 	"Options available :\n"
 	"-i : Input MIME encoded file (use '-' to input from STDIN)\n"
 	"\tIf <mime file> is a directory, it will be recursed\n"
@@ -90,7 +90,6 @@ char help[] = "ripMIME -i <mime file> -d
 	"--mailbox : Process mailbox file\n"
 	"--formdata : Process as form data (from HTML form etc)\n"
 	"\n"
-	"--no-tnef : Turn off TNEF/winmail.dat decoding\n"
 	"--no-ole : Turn off OLE decoding\n"
 	"--no-uudecode : Turns off the facility of detecting UUencoded attachments in emails\n"
 	"--no-quotedprintable : Turns off the facility of decoding QuotedPrintable data\n"
@@ -404,10 +403,6 @@ int RIPMIME_parse_parameters (struct RIP
 						{
 							MIME_set_decode_uudecode(0);
 						}
-						else if (strncmp (&(argv[i][2]), "no-tnef", 7) == 0)
-						{
-							MIME_set_decode_tnef (0);
-						}
 						else if (strncmp (&(argv[i][2]), "no-ole", 6) == 0)
 						{
 							MIME_set_decode_ole(0);