changeset 1658:0dee8ba737af

mailimport: allow multiple wiki email addrs
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 01 Nov 2006 17:49:27 +0100
parents e8b3d979dff3
children a434ee49b5a6
files MoinMoin/config/multiconfig.py MoinMoin/mail/mailimport.py
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/config/multiconfig.py	Wed Nov 01 01:12:36 2006 +0100
+++ b/MoinMoin/config/multiconfig.py	Wed Nov 01 17:49:27 2006 +0100
@@ -311,7 +311,7 @@
 
     mail_import_subpage_template = u"$from-$date-$subject" # used for mail import
     mail_import_pagename_envelope = u"%s" # use u"+ %s/" to add "+ " and "/" automatically
-    mail_import_wiki_address = None # the e-mail address for e-mails that should go into the wiki
+    mail_import_wiki_addrs = [] # the e-mail addresses for e-mails that should go into the wiki
     mail_import_secret = ""
 
     # some dangerous mimetypes (we don't use "content-disposition: inline" for them when a user
--- a/MoinMoin/mail/mailimport.py	Wed Nov 01 01:12:36 2006 +0100
+++ b/MoinMoin/mail/mailimport.py	Wed Nov 01 17:49:27 2006 +0100
@@ -123,7 +123,7 @@
             'from_addr': from_addr,
             'subject': subject, 'date': date}
 
-def get_pagename_content(request, msg, email_pagename_envelope, email_subpage_template, wiki_address):
+def get_pagename_content(request, msg, email_pagename_envelope, email_subpage_template, wiki_addrs):
     """ Generates pagename and content according to the specification
         that can be found on MoinMoin:FeatureRequests/WikiEmailintegration """
     generate_summary = False
@@ -131,7 +131,7 @@
 
     pagename_tpl = ""
     for addr in msg['target_addrs']:
-        if addr[1].strip().lower() == wiki_address:
+        if addr[1].strip().lower() in wiki_addrs:
             pagename_tpl = addr[0]
             break
 
@@ -203,14 +203,14 @@
 
     email_subpage_template = request.cfg.mail_import_subpage_template
     email_pagename_envelope = request.cfg.mail_import_pagename_envelope
-    wiki_address = request.cfg.mail_import_wiki_address or request.cfg.mail_from
+    wiki_addrs = request.cfg.mail_import_wiki_addrs
 
     request.user = user.get_by_email_address(request, msg['from_addr'][1])
 
     if not request.user:
         raise ProcessingError("No suitable user found for mail address %r" % (msg['from_addr'][1], ))
 
-    d = get_pagename_content(request, msg, email_pagename_envelope, email_subpage_template, wiki_address)
+    d = get_pagename_content(request, msg, email_pagename_envelope, email_subpage_template, wiki_addrs)
     pagename = d['pagename']
     generate_summary = d['generate_summary']
 
@@ -291,7 +291,7 @@
 
         from_col = email_to_markup(request, msg['from_addr'])
         to_col = ' '.join([email_to_markup(request, (realname, mailaddr))
-                           for realname, mailaddr in msg['target_addrs'] if mailaddr != wiki_address])
+                           for realname, mailaddr in msg['target_addrs'] if not mailaddr in wiki_addrs])
         subj_col = '[%s %s]' % (wikiutil.quoteName(pagename), msg['subject'])
         date_col = msg['date']
         attach_col = " ".join(attachment_links)