changeset 1696:70e505db8728

mailimport: fix backtrace for empty target addr realname, loop in target addrs until some realname was found
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 07 Dec 2006 21:19:46 +0100
parents 9ae9f564380e
children 7c58e8af1a97
files MoinMoin/mail/mailimport.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/mail/mailimport.py	Thu Dec 07 17:05:13 2006 +0100
+++ b/MoinMoin/mail/mailimport.py	Thu Dec 07 21:19:46 2006 +0100
@@ -143,9 +143,10 @@
                 if addr[1].strip().lower() in wiki_addrs:
                     pagename_tpl = addr[0]
                     # special fix for outlook users :-)
-                    if pagename_tpl[-1] == pagename_tpl[0] == "'":
+                    if pagename_tpl and pagename_tpl[-1] == pagename_tpl[0] == "'":
                         pagename_tpl = pagename_tpl[1:-1]
-                    break
+                    if pagename_tpl:
+                        break
         elif method == 'subj':
             m = re_subject.search(subj)
             if m: