CVS: tmda/TMDA Util.py,1.93,1.94

"Jason R. Mastaler" <[email protected]>
Newsgroups gmane.mail.spam.tmda.cvs
Message-ID <[email protected]>
Update of /cvsroot/tmda/tmda/TMDA
In directory sc8-pr-cvs1:/tmp/cvs-serv30946/TMDA

Modified Files:
	Util.py 
Log Message:
Bugfix.  The TEMPLATE_DIR_MATCH_SENDER feature would throw an
IndexError if the message had a non-standard envelope sender address.
Now, if we encounter such a message, we just pass on trying to append
the address parts to the search list.


Index: Util.py
===================================================================
RCS file: /cvsroot/tmda/tmda/TMDA/Util.py,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -r1.93 -r1.94
--- Util.py	14 May 2003 06:00:23 -0000	1.93
+++ Util.py	22 May 2003 22:28:07 -0000	1.94
@@ -808,11 +808,14 @@
     if Defaults.TEMPLATE_DIR_MATCH_SENDER and Defaults.TEMPLATE_DIR:
         sender = os.environ.get('SENDER').lower()
         searchdirs.append(os.path.join(Defaults.TEMPLATE_DIR, sender))
-        domainparts = sender.split('@', 1)[1].split('.')
-        for i in range(len(domainparts)):
-            searchdirs.append(os.path.join
-                              (Defaults.TEMPLATE_DIR, '.'.join(domainparts)))
-            del domainparts[0]
+        try:
+            domainparts = sender.split('@', 1)[1].split('.')
+            for i in range(len(domainparts)):
+                searchdirs.append(os.path.join
+                                  (Defaults.TEMPLATE_DIR, '.'.join(domainparts)))
+                del domainparts[0]
+        except IndexError:
+            pass
     searchdirs.append(Defaults.TEMPLATE_DIR)
     searchdirs.append(os.path.join(Defaults.PARENTDIR, 'templates'))
     searchdirs.append(os.path.join(sys.prefix, 'share/tmda'))

_______________________________________
tmda-cvs mailing list
http://tmda.net/lists/listinfo/tmda-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.