SF.net SVN: tmda: [2067] trunk/tmda/TMDA/Queue/MaildirQueue.py

[email protected] Wed, 04 Oct 2006 14:30:37 -0700
Newsgroups gmane.mail.spam.tmda.cvs
Message-ID <[email protected]>
Revision: 2067
          http://svn.sourceforge.net/tmda/?rev=2067&view=rev
Author:   jasonrm
Date:     2006-10-04 14:30:35 -0700 (Wed, 04 Oct 2006)

Log Message:
-----------
check new/ before cur/ since on average, it's more likely the message is in new/

Modified Paths:
--------------
    trunk/tmda/TMDA/Queue/MaildirQueue.py

Modified: trunk/tmda/TMDA/Queue/MaildirQueue.py
===================================================================
--- trunk/tmda/TMDA/Queue/MaildirQueue.py	2006-10-04 21:18:11 UTC (rev 2066)
+++ trunk/tmda/TMDA/Queue/MaildirQueue.py	2006-10-04 21:30:35 UTC (rev 2067)
@@ -151,9 +151,9 @@
 
 
     def fetch_message(self, mailid, fullParse=False):
-	msgs = (glob.glob(os.path.join(Defaults.PENDING_DIR, 'cur/') 
+	msgs = (glob.glob(os.path.join(Defaults.PENDING_DIR, 'new/') 
 			  + '[0-9]*.[0-9]*.*')) + \
-			  (glob.glob(os.path.join(Defaults.PENDING_DIR, 'new/') 
+			  (glob.glob(os.path.join(Defaults.PENDING_DIR, 'cur/') 
 				     + '[0-9]*.[0-9]*.*'))
 	for m in msgs:
 	    if mailid in m:
@@ -165,9 +165,9 @@
 
 
     def delete_message(self, mailid):
-	msgs = (glob.glob(os.path.join(Defaults.PENDING_DIR, 'cur/') 
+	msgs = (glob.glob(os.path.join(Defaults.PENDING_DIR, 'new/') 
 			  + '[0-9]*.[0-9]*.*')) + \
-			  (glob.glob(os.path.join(Defaults.PENDING_DIR, 'new/') 
+			  (glob.glob(os.path.join(Defaults.PENDING_DIR, 'cur/') 
 				     + '[0-9]*.[0-9]*.*'))
 	for m in msgs:
 	    if mailid in m:
@@ -177,8 +177,8 @@
     def find_message(self, mailid):
 	cwd = os.getcwd()
 	os.chdir(Defaults.PENDING_DIR)
-	msgs = glob.glob('cur/[0-9]*.[0-9]*.*') + \
-	    glob.glob('new/[0-9]*.[0-9]*.*')
+	msgs = glob.glob('new/[0-9]*.[0-9]*.*') + \
+	    glob.glob('cur/[0-9]*.[0-9]*.*')
 
 	for i in range(5):
 	    for m in msgs:
@@ -189,8 +189,8 @@
 		# retry several times in case a MUA moved/renamed the
 		# message to cur/
 		time.sleep(1)
-		msgs = glob.glob('cur/[0-9]*.[0-9]*.*') + \
-		    glob.glob('new/[0-9]*.[0-9]*.*')
+		msgs = glob.glob('new/[0-9]*.[0-9]*.*') + \
+		    glob.glob('cur/[0-9]*.[0-9]*.*')
 		continue
 	os.chdir(cwd)
 	# give up; message is not there


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.