def sendError(self, exc): if exc.code and exc.resp: error = re.match(r'^([0-9\.]+) ', exc.resp) error_str = "" if error: error_str = error.group(1) key = str(exc.code) + " " + error.group(1) if key in smtp_errors: error_str += " " + smtp_errors[key] log.err("Failed to contact %s:%d (SMTP Error: %.3d %s)" % (smtp_host, smtp_port, exc.code, error_str)) log.debug("Failed to contact %s:%d (SMTP Error: %.3d %s)" % (smtp_host, smtp_port, exc.code, exc.resp)) SMTPClient.sendError(self, exc)
def esmtp_sendError(self, exc): if exc.code and exc.resp: error_str = "" error = re.match(r'^([0-9\.]+) ', exc.resp) if error: key = str(exc.code) + " " + error.group(1) if key in smtp_errors: error_str += " " + smtp_errors[key] verb = '[unknown]' if 'authentication' in exc.resp: verb = 'autenticate' if 'not support secure' in exc.resp: verb = 'negotiate TLS' log.err("Failed to %s to %s:%d (SMTP Code: %.3d) (%s)" % (verb, smtp_host, smtp_port, exc.code, error_str)) SMTPClient.sendError(self, exc)