@@ -50,6 +50,7 @@ fixes
- fixed issue #459. Changed the way of obtaining logger in reindex task.
- fixed #453 added ID field in whoosh SCHEMA that solves the issue of
reindexing modified files
- fixes #481 rhodecode emails are sent without Date header
1.3.6 (**2012-05-17**)
----------------------
@@ -3,6 +3,7 @@ from rhodecode.lib.rcmail.response impor
from rhodecode.lib.rcmail.exceptions import BadHeaders
from rhodecode.lib.rcmail.exceptions import InvalidMessage
class Attachment(object):
"""
Encapsulates file attachment information.
@@ -134,13 +135,13 @@ class Message(object):
if not self.recipients:
raise InvalidMessage, "No recipients have been added"
raise InvalidMessage("No recipients have been added")
if not self.body and not self.html:
raise InvalidMessage, "No body has been set"
raise InvalidMessage("No body has been set")
if not self.sender:
raise InvalidMessage, "No sender address has been set"
raise InvalidMessage("No sender address has been set")
if self.is_bad_headers():
raise BadHeaders
@@ -364,6 +364,7 @@ def to_message(mail, separator="; "):
return out
class MIMEPart(MIMEBase):
A reimplementation of nearly everything in email.mime to be more useful
@@ -387,7 +388,8 @@ class MIMEPart(MIMEBase):
self.set_payload(encoded, charset=charset)
def extract_payload(self, mail):
if mail.body == None: return # only None, '' is still ok
if mail.body == None:
return # only None, '' is still ok
ctype, ctype_params = mail.content_encoding['Content-Type']
cdisp, cdisp_params = mail.content_encoding['Content-Disposition']
@@ -415,7 +417,8 @@ class MIMEPart(MIMEBase):
def header_to_mime_encoding(value, not_email=False, separator=", "):
if not value: return ""
if not value:
return ""
encoder = Charset(DEFAULT_ENCODING)
if type(value) == list:
@@ -424,6 +427,7 @@ def header_to_mime_encoding(value, not_e
else:
return properly_encode_header(value, encoder, not_email)
def properly_encode_header(value, encoder, not_email):
The only thing special (weird) about this function is that it tries
@@ -21,10 +21,11 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import time
import logging
import smtplib
from socket import sslerror
from email.utils import formatdate
from rhodecode.lib.rcmail.message import Message
@@ -59,8 +60,11 @@ class SmtpMailer(object):
if isinstance(recipients, basestring):
recipients = [recipients]
headers = {
'Date': formatdate(time.time())
}
msg = Message(subject, recipients, body, html, self.mail_from,
recipients_separator=", ")
recipients_separator=", ", extra_headers=headers)
raw_msg = msg.to_message()
if self.ssl:
Status change: