Index: /trunk/email2trac.py.in
===================================================================
--- /trunk/email2trac.py.in	(revision 293)
+++ /trunk/email2trac.py.in	(revision 294)
@@ -132,4 +132,6 @@
 		self.author     = None
 		self.id         = None
+		
+		self.STRIP_CONTENT_TYPES = list()
 
 		self.VERSION = version
@@ -236,17 +238,16 @@
 
 		if parameters.has_key('binhex'):
-			self.BINHEX = parameters['binhex']
-		else:
-			self.BINHEX = 'warn'
+			self.STRIP_CONTENT_TYPES.append('application/mac-binhex40')
 
 		if parameters.has_key('applesingle'):
-			self.APPLESINGLE = parameters['applesingle']
-		else:
-			self.APPLESINGLE = 'warn'
+			self.STRIP_CONTENT_TYPES.append('application/applefile')
 
 		if parameters.has_key('appledouble'):
-			self.APPLEDOUBLE = parameters['appledouble']
-		else:
-			self.APPLEDOUBLE = 'warn'
+			self.STRIP_CONTENT_TYPES.append('application/applefile')
+
+		if parameters.has_key('strip_content_types'):
+			items = parameters['strip_content_types'].split(',')
+			for item in items:
+				self.STRIP_CONTENT_TYPES.append(item.strip())
 
 		self.WORKFLOW = None
@@ -1088,10 +1089,5 @@
 		"""
 		message_parts = []
-		
-		# This is used to figure out when we are inside an AppleDouble container
-		# AppleDouble containers consists of two parts: Mac-specific file data, and platform-independent data
-		# We strip away Mac-specific stuff
-		appledouble_parts = []
-
+	
 		ALTERNATIVE_MULTIPART = False
 
@@ -1101,51 +1097,20 @@
 				print 'TD: Message part: Content-Type: %s' % part.get_content_type()
 
-
-			# Check whether we just finished processing an AppleDouble container
-			if part not in appledouble_parts:
-				appledouble_parts = []
-
 			## Check content type
-			#
-			if part.get_content_type() == 'application/mac-binhex40':
-				#
-				# Special handling for BinHex attachments. Options are drop (leave out with no warning), warn (and leave out), and keep
-				#
-				if self.BINHEX == 'warn':
-					message_parts.append("'''A BinHex attachment named '%s' was ignored (use MIME encoding instead).'''" % part.get_filename())
-					continue
-				elif self.BINHEX == 'drop':
-					continue
-
-			elif part.get_content_type() == 'application/applefile':
-				#
-				# Special handling for the Mac-specific part of AppleDouble/AppleSingle attachments. Options are strip (leave out with no warning), warn (and leave out), and keep
-				#
-				
-				if part in appledouble_parts: 
-					if self.APPLEDOUBLE == 'warn':
-						message_parts.append("'''The resource fork of an attachment named '%s' was removed.'''" % part.get_filename())
-						continue
-					elif self.APPLEDOUBLE == 'strip':
-						continue
-				else:
-					if self.APPLESINGLE == 'warn':
-						message_parts.append("'''An AppleSingle attachment named '%s' was ignored (use MIME encoding instead).'''" % part.get_filename())
-						continue
-					elif self.APPLESINGLE == 'drop':
-						continue
-
-			elif part.get_content_type() == 'multipart/appledouble':
-				#
-				# If we entering an AppleDouble container, set up appledouble_parts so that we know what to do with its subparts
-				#
-				appledouble_parts = part.get_payload()
+			# 
+			if part.get_content_type() in self.STRIP_CONTENT_TYPES:
+
+				if self.DEBUG:
+					print "TD: A %s attachment named '%s' was skipped" %(part.get_content_type(), part.get_filename())
+
 				continue
 
-			elif part.get_content_type() == 'multipart/alternative':
+			## Catch some mulitpart execptions
+			#
+			if part.get_content_type() == 'multipart/alternative':
 				ALTERNATIVE_MULTIPART = True
 				continue
 
-			# Skip multipart containers
+			## Skip multipart containers
 			#
 			if part.get_content_maintype() == 'multipart':
@@ -1154,8 +1119,10 @@
 				continue
 			
-			# Check if this is an inline part. It's inline if there is co Cont-Disp header, or if there is one and it says "inline"
+			## Check if this is an inline part. It's inline if there is co Cont-Disp header, or if there is one and it says "inline"
+			#
 			inline = self.inline_part(part)
 
-			# Drop HTML message
+			## Drop HTML message
+			#
 			if ALTERNATIVE_MULTIPART and self.DROP_ALTERNATIVE_HTML_VERSION:
 				if part.get_content_type() == 'text/html':
@@ -1166,5 +1133,6 @@
 					continue
 
-			# Inline text parts are where the body is
+			## Inline text parts are where the body is
+			#
 			if part.get_content_type() == 'text/plain' and inline:
 				if self.DEBUG:
@@ -1192,5 +1160,5 @@
 					body_text = self.wrap_text(body_text)
 
-				# Get contents charset (iso-8859-15 if not defined in mail headers)
+				## Get contents charset (iso-8859-15 if not defined in mail headers)
 				#
 				charset = part.get_content_charset()
