Index: emailtotracscript/trunk/ChangeLog
===================================================================
--- emailtotracscript/trunk/ChangeLog	(revision 67)
+++ emailtotracscript/trunk/ChangeLog	(revision 68)
@@ -1,10 +1,14 @@
-2006-04-??
+2006-05-16
 	- Fixed a bug when there was no plain text body.
 	  Reported by: Greg Deakyne
 	- Fixed a small bug if default component owner is unknown.
 	  Just fill in some bogus info.
-	- Use the short options for the install command. S it works for
+	- Use the short options for the install command. So it works for
 	  MacOSx
 	  Reported by: Nathaniel Irons
+	- Messages that has X-Virus-found in header are marked as SPAM
+	  Implemented by: Walter de Jong
+	- Some modules are changed for version 0.10, Added and made some
+	  minor changes: Patch supplied by: Markus Tacker  
 
 
Index: emailtotracscript/trunk/email2trac.py.in
===================================================================
--- emailtotracscript/trunk/email2trac.py.in	(revision 67)
+++ emailtotracscript/trunk/email2trac.py.in	(revision 68)
@@ -52,5 +52,5 @@
 	spam_level   : 4                 # OPTIONAL, if set check for SPAM mail 
 	reply_address: 1                 # OPTIONAL, if set then fill in ticket CC field
-        umask        : 022               # OPTIONAL, if set then use this umask for creation of the attachments
+    umask        : 022               # OPTIONAL, if set then use this umask for creation of the attachments
 	mailto_link  : 1                 # OPTIONAL, if set then [mailto:<CC>] in description 
 	trac_version : 0.8               # OPTIONAL, default is 0.9
@@ -100,8 +100,8 @@
 
 		self.VERSION = version
-		if self.VERSION > 0.8:
+		if self.VERSION == 0.8:
+			self.get_config = self.env.get_config
+		else:
 			self.get_config = self.env.config.get
-		else:
-			self.get_config = self.env.get_config
 
 		if parameters.has_key('umask'):
@@ -256,9 +256,9 @@
 		# Look for email address in registered trac users
 		#
-		if self.VERSION > 0.8:
+		if self.VERSION == 0.8:
+			users = []
+		else:
 			users = [ u for (u, n, e) in self.env.get_known_users(self.db)
 				if e == email_addr ]
-		else:
-			users = []
 
 		if len(users) == 1:
@@ -363,8 +363,8 @@
 		# Insert ticket in database
 		#
-		if self.VERSION > 0.8:
+		if self.VERSION == 0.8:
+			tkt['id'] = tkt.insert(self.db)
+		else:
 			tkt['id'] = tkt.insert()
-		else:
-			tkt['id'] = tkt.insert(self.db)
 
 		#
@@ -509,11 +509,11 @@
 
 			url_filename = urllib.quote(filename)
-			if self.VERSION > 0.8:
-				dir = '/tmp'
-			else:
+			if self.VERSION == 0.8:
 				dir = os.path.join(self.env.get_attachments_dir(), 'ticket', 
 				                    	urllib.quote(str(ticket['id'])))
 				if not os.path.exists(dir):
 					mkdir_p(dir, 0755)
+			else:
+				dir = '/tmp'
 
 			path, fd =  util.create_unique_file(os.path.join(dir, url_filename))
@@ -531,10 +531,5 @@
 			# Insert the attachment it differs for the different TRAC versions
 			#
-			if self.VERSION > 0.8:
-				fd = open(path)
-				att = attachment.Attachment(self.env, 'ticket', ticket['id'])
-				att.insert(url_filename, fd, filesize)
-				fd.close()
-			else:
+			if self.VERSION == 0.8:
 				cursor = self.db.cursor()
 				cursor.execute('INSERT INTO attachment VALUES("%s","%s","%s",%d,%d,"%s","%s","%s")' 
@@ -542,4 +537,9 @@
 					  int(time.time()),'', user, 'e-mail') ) 
 				self.db.commit()
+			else:
+				fd = open(path)
+				att = attachment.Attachment(self.env, 'ticket', ticket['id'])
+				att.insert(url_filename, fd, filesize)
+				fd.close()
 
 
@@ -634,12 +634,5 @@
 	#print settings
 
-	if version > 0.8:
-		from trac import attachment 
-		from trac.env import Environment
-		from trac.ticket import Ticket
-		from trac.Notify import TicketNotifyEmail
-		from trac.web.href import Href
-		from trac import util
-	else:
+	if version == 0.8:
 		from trac.Environment import Environment
 		from trac.Ticket import Ticket
@@ -647,4 +640,19 @@
 		from trac.Href import Href
 		from trac import util
+	elif version == 0.9:
+		from trac import attachment 
+		from trac.env import Environment
+		from trac.ticket import Ticket
+		from trac.web.href import Href
+		from trac import util
+		from trac.Notify import TicketNotifyEmail
+	elif version == 0.10:
+		from trac import attachment 
+		from trac.env import Environment
+		from trac.ticket import Ticket
+		from trac.web.href import Href
+		from trac import util
+		# see http://projects.edgewall.com/trac/changeset/2799
+		from trac.ticket.notification import TicketNotifyEmail
 
 	env = Environment(settings['project'], create=0)
