diff --git a/wallace/module_invitationpolicy.py b/wallace/module_invitationpolicy.py --- a/wallace/module_invitationpolicy.py +++ b/wallace/module_invitationpolicy.py @@ -1161,7 +1161,6 @@ """ global auth - import smtplib from email.MIMEText import MIMEText from email.Utils import formatdate from email.header import Header @@ -1284,14 +1283,13 @@ msg['From'] = Header(utils.str2unicode('%s' % orgname) if orgname else '') msg['From'].append("<%s>" % orgemail) - modules._sendmail(orgemail, receiving_user['mail'], msg.as_string()) + success = modules._sendmail(orgemail, receiving_user['mail'], msg.as_string()) log.debug(_("Sent update notification to %r: %r") % (receiving_user['mail'], success), level=8) def send_cancel_notification(object, receiving_user, deleted=False, sender=None, comment=None): """ Send a notification about event/task cancellation """ - import smtplib from email.MIMEText import MIMEText from email.Utils import formatdate from email.header import Header @@ -1346,7 +1344,7 @@ msg['From'] = Header(utils.str2unicode('%s' % orgname) if orgname else '') msg['From'].append("<%s>" % orgemail) - modules._sendmail(orgemail, receiving_user['mail'], msg.as_string()) + success = modules._sendmail(orgemail, receiving_user['mail'], msg.as_string()) log.debug(_("Sent cancel notification to %r: %r") % (receiving_user['mail'], success), level=8) def is_auto_reply(user, sender_email, type): diff --git a/wallace/module_resources.py b/wallace/module_resources.py --- a/wallace/module_resources.py +++ b/wallace/module_resources.py @@ -1312,7 +1312,6 @@ """ Send a reservation notification to the resource owner """ - import smtplib from pykolab import utils from email.MIMEText import MIMEText from email.Utils import formatdate @@ -1356,17 +1355,7 @@ resource['cn'], participant_status_label(status) if success else _('failed') )) - smtp = smtplib.SMTP("localhost", 10027) - - if conf.debuglevel > 8: - smtp.set_debuglevel(True) - - try: - smtp.sendmail(resource['mail'], owner['mail'], msg.as_string()) - except Exception, e: - log.error(_("SMTP sendmail error: %r") % (e)) - - smtp.quit() + modules._sendmail(resource['mail'], owner['mail'], msg.as_string()) def owner_notification_text(resource, owner, event, success): organizer = event.get_organizer()