diff --git a/trytond/trytond/sendmail.py b/trytond/trytond/sendmail.py index 43c66456af..bff52f7963 100644 --- a/trytond/trytond/sendmail.py +++ b/trytond/trytond/sendmail.py @@ -55,7 +55,8 @@ def sendmail(from_addr, to_addrs, msg, server=None, strict=False): logger.error('fail to send email', exc_info=True) except smtplib.SMTPResponseException as e: if count and 400 <= e.smtp_code <= 499 and hasattr(server, 'uri'): - server.quit() + if e.smtp_code != 421: + server.quit() server = get_smtp_server(server.uri, strict=strict) if server: continue