changeset 1290:655978c9f6c3

mailimport: generate subj/from/date header if we have no overview table
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 15 Aug 2006 18:20:39 +0200
parents 01d6d28d5039
children 277695e8e6f5 2625857eabf0
files MoinMoin/mail/mailimport.py
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/mail/mailimport.py	Tue Aug 15 17:55:12 2006 +0200
+++ b/MoinMoin/mail/mailimport.py	Tue Aug 15 18:20:39 2006 +0200
@@ -4,9 +4,6 @@
     Just call this script with the URL of the wiki as a single argument
     and feed the mail into stdin.
 
-    TODO:
-     * add from/to/subj infos when attaching to main page (without +)
-
     @copyright: 2006 by MoinMoin:AlexanderSchremmer,
                 2006 by MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
@@ -243,9 +240,14 @@
     # assemble old page content and new mail body together
     old_content = Page(request, pagename).get_raw_body()
     if old_content:
-        new_content = u"%s\n-----\n%s" % (old_content, d['content'], )
+        new_content = u"%s\n-----\n" % old_content
     else:
-        new_content = d['content']
+        new_content = ''
+
+    if not (generate_summary and "/" in pagename):
+        new_content += u"'''Mail: %s (%s, [[DateTime(%s)]])'''\n\n" % (msg['subject'], email_to_markup(request, msg['from_addr']), msg['date'])
+
+    new_content += d['content']
     new_content += "\n" + u"\n * ".join(attachment_links)
 
     try: