Browse Source

捕捉smtp异常

pull/26/head
ibuler 9 years ago
parent
commit
13d325e259
  1. 4
      install/install.py
  2. 2
      jumpserver.conf

4
install/install.py

@ -6,7 +6,7 @@ import time
import os
import sys
import MySQLdb
from smtplib import SMTP, SMTPAuthenticationError, SMTPConnectError
from smtplib import SMTP, SMTPAuthenticationError, SMTPConnectError, SMTPSenderRefused
import ConfigParser
import socket
import fcntl
@ -127,7 +127,7 @@ class PreSetup(object):
smtp.quit()
return True
except (SMTPAuthenticationError, socket.timeout, socket.gaierror), e:
except (SMTPAuthenticationError, socket.timeout, socket.gaierror, SMTPSenderRefused, SMTPConnectError), e:
color_print(e, 'red')
return False

2
jumpserver.conf

@ -19,5 +19,5 @@ email_host = smtp.qq.com
email_port = 25
email_host_user = xxxxxxxx@qq.com
email_host_password = xxxxxx
email_use_tls = True
email_use_tls = False

Loading…
Cancel
Save