X-Git-Url: https://git.llucax.com/software/sercom-old.git/blobdiff_plain/42bbf3168fcad3b894a1a78568450db38672ac57..4d996d9a8b118836ad4de537ead8144b78bf530f:/src/sc_deliver?ds=sidebyside diff --git a/src/sc_deliver b/src/sc_deliver index 45975cd..cd4bc00 100755 --- a/src/sc_deliver +++ b/src/sc_deliver @@ -30,9 +30,17 @@ a su intento %d, recibido el %s. mail['Return-Path'] = conf.get('mail', 'admin') mail['X-Mailer'] = 'sercom ' + sercom.VERSION mail['X-Priority'] = '5' - smtp = smtplib.SMTP(conf.get('mail', 'smtp')) - smtp.sendmail(mail['From'], mail['To'], mail.as_string()) - smtp.close() + sent = False + while not sent: + try: + smtp = smtplib.SMTP(conf.get('mail', 'smtp')) + smtp.sendmail(mail['From'], mail['To'], mail.as_string()) + smtp.close() + sent = True + except smtplib.SMTPException, e: + log.warning('No se pudo enviar el mail a %s (%s)', + inscripto.padron, inscripto.mail) + time.sleep(1) # Inicializo conf, conn, log = sercom.init('deliver')