changeset 1688:07da298b129a

mail import: mail_import_pagename_regex determines how to find/extract the pagename from the subject
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 26 Nov 2006 16:19:22 +0100
parents 1d358ccc0f2f
children 7b80735ede14
files MoinMoin/config/multiconfig.py MoinMoin/mail/mailimport.py
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/config/multiconfig.py	Sun Nov 26 16:12:55 2006 +0100
+++ b/MoinMoin/config/multiconfig.py	Sun Nov 26 16:19:22 2006 +0100
@@ -312,6 +312,7 @@
     mail_import_subpage_template = u"$from-$date-$subject" # used for mail import
     mail_import_pagename_search = ['subject', 'to', ] # where to look for target pagename (and in which order)
     mail_import_pagename_envelope = u"%s" # use u"+ %s/" to add "+ " and "/" automatically
+    mail_import_pagename_regex = r"\[([^\]]*)\]" # how to find/extract the pagename from the subject
     mail_import_wiki_addrs = [] # the e-mail addresses for e-mails that should go into the wiki
     mail_import_secret = ""
 
--- a/MoinMoin/mail/mailimport.py	Sun Nov 26 16:12:55 2006 +0100
+++ b/MoinMoin/mail/mailimport.py	Sun Nov 26 16:19:22 2006 +0100
@@ -25,7 +25,6 @@
 
 debug = False
 
-re_subject = re.compile(r"\[([^\]]*)\]")
 re_sigstrip = re.compile("\r?\n-- \r?\n.*$", re.S)
 
 class attachment(object):
@@ -134,6 +133,7 @@
     email_pagename_envelope = cfg.mail_import_pagename_envelope
     wiki_addrs = cfg.mail_import_wiki_addrs
     search_list = cfg.mail_import_pagename_search
+    re_subject = re.compile(cfg.mail_import_pagename_regex)
 
     subj = msg['subject'].strip()
     pagename_tpl = ""