creditease-sec / insight

洞察-宜信集应用系统资产管理、漏洞全生命周期管理、安全知识库管理三位一体的平台。
GNU General Public License v3.0
1.17k stars 442 forks source link

邮件发不出去 #18

Open alphisilaw opened 6 years ago

alphisilaw commented 6 years ago

[root@localhost log]# cat gunicorn.err |more [2018-04-24 10:13:14 +0000] [13] [INFO] Starting gunicorn 19.6.0 [2018-04-24 10:13:14 +0000] [13] [INFO] Listening at: http://0.0.0.0:5000 (13) [2018-04-24 10:13:14 +0000] [13] [INFO] Using worker: sync [2018-04-24 10:13:14 +0000] [23] [INFO] Booting worker with pid: 23 [2018-04-24 10:13:14 +0000] [28] [INFO] Booting worker with pid: 28 [2018-04-24 10:13:14 +0000] [29] [INFO] Booting worker with pid: 29 [2018-04-24 10:13:14 +0000] [30] [INFO] Booting worker with pid: 30 Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib64/python2.7/threading.py", line 812, in bootstrap_inner self.run() File "/usr/lib64/python2.7/threading.py", line 765, in run self.target(*self.args, **self.kwargs) File "/opt/webapp/srcpm/app/email.py", line 23, in send_async_email mail.send(msg) File "/usr/lib/python2.7/site-packages/flask_mail.py", line 491, in send with self.connect() as connection: File "/usr/lib/python2.7/site-packages/flask_mail.py", line 144, in enter__ self.host = self.configure_host() File "/usr/lib/python2.7/site-packages/flask_mail.py", line 158, in configure_host host = smtplib.SMTP(self.mail.server, self.mail.port) File "/usr/lib64/python2.7/smtplib.py", line 255, in init__ (code, msg) = self.connect(host, port) File "/usr/lib64/python2.7/smtplib.py", line 316, in connect (code, msg) = self.getreply() File "/usr/lib64/python2.7/smtplib.py", line 367, in getreply raise SMTPServerDisconnected("Connection unexpectedly closed") SMTPServerDisconnected: Connection unexpectedly closed

byr0nchan commented 6 years ago

是的,卡在邮件发送这里,怎么设置各种邮箱服务器都不行!

cat gunicorn.err |more

send: 'ehlo [172.17.0.3]\r\n' reply: '250-smtp.qq.com\r\n' reply: '250-PIPELINING\r\n' reply: '250-SIZE 73400320\r\n' reply: '250-STARTTLS\r\n' reply: '250-AUTH LOGIN PLAIN\r\n' reply: '250-AUTH=LOGIN\r\n' reply: '250-MAILCOMPRESS\r\n' reply: '250 8BITMIME\r\n' reply: retcode (250); Msg: smtp.qq.com PIPELINING SIZE 73400320 STARTTLS AUTH LOGIN PLAIN AUTH=LOGIN MAILCOMPRESS 8BITMIME send: 'STARTTLS\r\n' reply: '220 Ready to start TLS\r\n' reply: retcode (220); Msg: Ready to start TLS send: 'ehlo [172.17.0.3]\r\n' reply: '250-smtp.qq.com\r\n' reply: '250-PIPELINING\r\n' reply: '250-SIZE 73400320\r\n' reply: '250-AUTH LOGIN PLAIN\r\n' reply: '250-AUTH=LOGIN\r\n' reply: '250-MAILCOMPRESS\r\n' reply: '250 8BITMIME\r\n' reply: retcode (250); Msg: smtp.qq.com PIPELINING SIZE 73400320 AUTH LOGIN PLAIN AUTH=LOGIN MAILCOMPRESS 8BITMIME send: 'AUTH PLAIN ADkwNzg1MjQ2NEBxcS5jb20AQ2JyMTk0OTEwMQ==\r\n' reply: '535 Error: \xc7\xeb\xca\xb9\xd3\xc3\xca\xda\xc8\xa8\xc2\xeb\xb5\xc7\xc2\xbc\xa1\xa3\x cf\xea\xc7\xe9\xc7\xeb\xbf\xb4: http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=28&&no= 1001256\r\n' reply: retcode (535); Msg: Error: ȫʹԃ˚ȨëµȂ¼¡£Ъȩȫ¿´: http://service.mail.qq.com/cgi-bin/ help?subtype=1&&id=28&&no=1001256 Exception in thread Thread-3: Traceback (most recent call last): File "/usr/lib64/python2.7/threading.py", line 812, in __bootstrap_inner self.run() File "/usr/lib64/python2.7/threading.py", line 765, in run self.target(*self.args, **self.kwargs) File "/opt/webapp/srcpm/app/email.py", line 23, in send_async_email mail.send(msg) File "/usr/lib/python2.7/site-packages/flask_mail.py", line 491, in send with self.connect() as connection: File "/usr/lib/python2.7/site-packages/flask_mail.py", line 144, in enter__ self.host = self.configure_host() File "/usr/lib/python2.7/site-packages/flask_mail.py", line 165, in configure_host host.login(self.mail.username, self.mail.password) File "/usr/lib64/python2.7/smtplib.py", line 621, in login raise SMTPAuthenticationError(code, resp) SMTPAuthenticationError: (535, 'Error: \xc7\xeb\xca\xb9\xd3\xc3\xca\xda\xc8\xa8\xc2\xeb\xb5\x c7\xc2\xbc\xa1\xa3\xcf\xea\xc7\xe9\xc7\xeb\xbf\xb4: http://service.mail.qq.com/cgi-bin/help?s ubtype=1&&id=28&&no=1001256')

byr0nchan commented 6 years ago

@alphisilaw 看看昨天我尝试的这个 https://github.com/creditease-sec/insight/issues/19

byr0nchan commented 6 years ago

将里面的参数改为你自己的邮件服务就可以了,如果用的是QQ邮箱,发送密码不是你的QQ登录密码,而是QQ邮箱里的授权码,可以登录QQ邮箱后按下面路径获取:设置=》帐户=》POP3/SMTP服务=》然后开启POP3/SMTP服务,点击生成授权码就可以了

tuotujingshui commented 5 years ago

新浪邮箱无法发送邮件,请问新浪邮箱是否要修改‘utf-8’之类的才可以?