summaryrefslogtreecommitdiffstats
path: root/wallace
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2015-05-14 09:46:32 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2015-05-14 09:46:32 +0200
commit003a896c14c4a1c6292c9f1979732b82b40a7376 (patch)
treed55c93eb1ff6578b7826215036e02bd6fdabe05e /wallace
parent929e67a6912add9ab3bdc070e23ca731cd1d2d33 (diff)
downloadpykolab-003a896c14c4a1c6292c9f1979732b82b40a7376.tar.gz
Don't smtp.quit() if no connection had been created (successfully), and please do attempt to send the result again and again (logging errors helps)
Diffstat (limited to 'wallace')
-rw-r--r--wallace/module_invitationpolicy.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/wallace/module_invitationpolicy.py b/wallace/module_invitationpolicy.py
index 278d192..edd23a9 100644
--- a/wallace/module_invitationpolicy.py
+++ b/wallace/module_invitationpolicy.py
@@ -1208,13 +1208,16 @@ def send_update_notification(object, receiving_user, old=None, reply=True):
if conf.debuglevel > 8:
smtp.set_debuglevel(True)
- try:
- success = smtp.sendmail(orgemail, receiving_user['mail'], msg.as_string())
- log.debug(_("Sent update notification to %r: %r") % (receiving_user['mail'], success), level=8)
- except Exception, e:
- log.error(_("SMTP sendmail error: %r") % (e))
+ success = False
- smtp.quit()
+ while not success:
+ try:
+ success = smtp.sendmail(orgemail, receiving_user['mail'], msg.as_string())
+ log.debug(_("Sent update notification to %r: %r") % (receiving_user['mail'], success), level=8)
+ smtp.quit()
+ except Exception, e:
+ log.error(_("SMTP sendmail error: %r") % (e))
+ time.sleep(10)
def send_cancel_notification(object, receiving_user, deleted=False):