diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py
index 45fb8e8b583c94829aa4cb30f60279194fff76bc..06d3a6018a1c2fcedc8d8d5f656cf8eefa104457 100644 (file)
--- a/roundup/roundupdb.py
+++ b/roundup/roundupdb.py
from email.MIMEText import MIMEText
from email.MIMEBase import MIMEBase
+from anypy.email_ import FeedParser
+
from roundup import password, date, hyperdb
from roundup.i18n import _
elif isinstance(proptype, hyperdb.Interval):
props[propname] = date.Interval(value)
elif isinstance(proptype, hyperdb.Password):
- props[propname] = password.Password()
- props[propname].unpack(value)
+ props[propname] = password.Password(encrypted=value)
# tag new user creation with 'admin'
self.journaltag = 'admin'
# Because getting a logger requires acquiring a lock, we want
# to do it only once.
if not hasattr(self, '__logger'):
- self.__logger = logging.getLogger('hyperdb')
+ self.__logger = logging.getLogger('roundup.hyperdb')
return self.__logger
user or a user who has already seen the message.
Also check permissions on the message if not a system
message: A user must have view permission on content and
- files to be on the receiver list. We do *not* check the
+ files to be on the receiver list. We do *not* check the
author etc. for now.
"""
allowed = True
if message_files:
# first up the text as a part
part = MIMEText(body)
+ part.set_charset(charset)
encode_quopri(part)
message.attach(part)
else:
part = MIMEText(content)
part['Content-Transfer-Encoding'] = '7bit'
+ elif mime_type == 'message/rfc822':
+ main, sub = mime_type.split('/')
+ p = FeedParser()
+ p.feed(content)
+ part = MIMEBase(main, sub)
+ part.set_payload([p.close()])
else:
# some other type, so encode it
if not mime_type:
part = MIMEBase(main, sub)
part.set_payload(content)
Encoders.encode_base64(part)
- part['Content-Disposition'] = 'attachment;\n filename="%s"'%name
+ cd = 'Content-Disposition'
+ part[cd] = 'attachment;\n filename="%s"'%name
message.attach(part)
else: