changeset 1594:53bd1632c92a

Merge with main.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Tue, 26 Sep 2006 23:43:25 +0200
parents d841e19410e9 (current diff) 26fbd0276b12 (diff)
children 706de8a16147
files
diffstat 2 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/mail/mailimport.py	Tue Sep 26 23:42:13 2006 +0200
+++ b/MoinMoin/mail/mailimport.py	Tue Sep 26 23:43:25 2006 +0200
@@ -80,8 +80,9 @@
     from_addr = get_addrs(message, 'From')[0]
     to_addrs = get_addrs(message, 'To')
     cc_addrs = get_addrs(message, 'Cc')
-    bcc_addrs = get_addrs(message, 'Bcc')
-    target_addrs = to_addrs + cc_addrs + bcc_addrs
+    bcc_addrs = get_addrs(message, 'Bcc') # depending on sending MTA, this can be present or not
+    envelope_to_addrs = get_addrs(message, 'X-Original-To') + get_addrs(message, 'X-Envelope-To') # Postfix / Sendmail does this
+    target_addrs = to_addrs + cc_addrs + bcc_addrs + envelope_to_addrs
 
     subject = decode_2044(message['Subject'])
     date = time.strftime("%Y-%m-%dT%H:%M:%S", time.gmtime(mktime_tz(parsedate_tz(message['Date']))))
@@ -117,7 +118,8 @@
 
     return {'text': u"".join(text_data), 'html': u"".join(html_data),
             'attachments': attachments,
-            'target_addrs': target_addrs, 'to_addrs': to_addrs, 'cc_addrs': cc_addrs, 'bcc_addrs': bcc_addrs,
+            'target_addrs': target_addrs,
+            'to_addrs': to_addrs, 'cc_addrs': cc_addrs, 'bcc_addrs': bcc_addrs, 'envelope_to_addrs': envelope_to_addrs,
             'from_addr': from_addr,
             'subject': subject, 'date': date}
 
--- a/MoinMoin/request/__init__.py	Tue Sep 26 23:42:13 2006 +0200
+++ b/MoinMoin/request/__init__.py	Tue Sep 26 23:43:25 2006 +0200
@@ -8,6 +8,7 @@
 """
 
 import os, re, time, sys, cgi, StringIO
+import logging
 import copy
 
 try: