diff --git a/roundup/roundupdb.py b/roundup/roundupdb.py
index 570c767e49e0bd7bc6a00ac18dfb98876f68cce8..5ba6b4512e03952a1b458f36b03053a01392dafc 100644 (file)
--- a/roundup/roundupdb.py
+++ b/roundup/roundupdb.py
from roundup.i18n import _
# MessageSendError is imported for backwards compatibility
-from roundup.mailer import Mailer, MessageSendError, encode_quopri
+from roundup.mailer import Mailer, MessageSendError, encode_quopri, \
+ nice_sender_header
class Database:
""" Make sure we don't send mail to either the anonymous
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 permisson on content and
+ message: A user must have view permission on content and
files to be on the receiver list. We do *not* check the
author etc. for now.
"""
if msgid :
for fileid in messages.get(msgid, 'files') :
# check the attachment size
- filename = self.db.filename('file', fileid, None)
- filesize = os.path.getsize(filename)
+ filesize = self.db.filesize('file', fileid, None)
if filesize <= self.db.config.NOSY_MAX_ATTACHMENT_SIZE:
message_files.append(fileid)
else:
else:
sendto = [sendto]
+ # tracker sender info
tracker_name = unicode(self.db.config.TRACKER_NAME, 'utf-8')
- tracker_name = formataddr((tracker_name, from_address))
- tracker_name = Header(tracker_name, charset)
+ tracker_name = nice_sender_header(tracker_name, from_address,
+ charset)
# now send one or more messages
# TODO: I believe we have to create a new message each time as we