X-Git-Url: https://git.llucax.com/software/sercom-old.git/blobdiff_plain/42bbf3168fcad3b894a1a78568450db38672ac57..7f32a60f31bd104bc04c102bf6c66dd2af7220e7:/src/sc_deliver?ds=inline 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')