{"action":"created","issue":{"url":"https://api.github.com/repos/jumpserver/jumpserver/issues/767","repository_url":"https://api.github.com/repos/jumpserver/jumpserver","labels_url":"https://api.github.com/repos/jumpserver/jumpserver/issues/767/labels{/name}","comments_url":"https://api.github.com/repos/jumpserver/jumpserver/issues/767/comments","events_url":"https://api.github.com/repos/jumpserver/jumpserver/issues/767/events","html_url":"https://github.com/jumpserver/jumpserver/issues/767","id":266403007,"number":767,"title":"添加用户，发送邮件错误","user":{"login":"wocswang","id":23565529,"avatar_url":"https://avatars1.githubusercontent.com/u/23565529?v=4","gravatar_id":"","url":"https://api.github.com/users/wocswang","html_url":"https://github.com/wocswang","followers_url":"https://api.github.com/users/wocswang/followers","following_url":"https://api.github.com/users/wocswang/following{/other_user}","gists_url":"https://api.github.com/users/wocswang/gists{/gist_id}","starred_url":"https://api.github.com/users/wocswang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wocswang/subscriptions","organizations_url":"https://api.github.com/users/wocswang/orgs","repos_url":"https://api.github.com/users/wocswang/repos","events_url":"https://api.github.com/users/wocswang/events{/privacy}","received_events_url":"https://api.github.com/users/wocswang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-10-18T08:27:59Z","updated_at":"2017-10-18T09:09:16Z","closed_at":null,"author_association":"NONE","body":"\r\n[2017-10-18 16:00:53,289: ERROR/ForkPoolWorker-2] Task common.tasks.send_mail_async[e871555b-3e0e-4234-8b45-863b79038ab0] raised unexpected: gaierror(-2, 'Name or service not known')\r\nTraceback (most recent call last):\r\n  File \"/opt/py3/lib/python3.6/site-packages/celery/app/trace.py\", line 374, in trace_task\r\n    R = retval = fun(*args, **kwargs)\r\n  File \"/opt/py3/lib/python3.6/site-packages/celery/app/trace.py\", line 629, in __protected_call__\r\n    return self.run(*args, **kwargs)\r\n  File \"/opt/jumpserver/apps/common/tasks.py\", line 29, in send_mail_async\r\n    send_mail(*args, **kwargs)\r\n  File \"/opt/py3/lib/python3.6/site-packages/django/core/mail/__init__.py\", line 62, in send_mail\r\n    return mail.send()\r\n  File \"/opt/py3/lib/python3.6/site-packages/django/core/mail/message.py\", line 348, in send\r\n    return self.get_connection(fail_silently).send_messages([self])\r\n  File \"/opt/py3/lib/python3.6/site-packages/django/core/mail/backends/smtp.py\", line 104, in send_messages\r\n    new_conn_created = self.open()\r\n  File \"/opt/py3/lib/python3.6/site-packages/django/core/mail/backends/smtp.py\", line 64, in open\r\n    self.connection = self.connection_class(self.host, self.port, **connection_params)\r\n  File \"/root/.pyenv/versions/3.6.0/lib/python3.6/smtplib.py\", line 251, in __init__\r\n    (code, msg) = self.connect(host, port)\r\n  File \"/root/.pyenv/versions/3.6.0/lib/python3.6/smtplib.py\", line 335, in connect\r\n    self.sock = self._get_socket(host, port, self.timeout)\r\n  File \"/root/.pyenv/versions/3.6.0/lib/python3.6/smtplib.py\", line 306, in _get_socket\r\n    self.source_address)\r\n  File \"/root/.pyenv/versions/3.6.0/lib/python3.6/socket.py\", line 704, in create_connection\r\n    for res in getaddrinfo(host, port, 0, SOCK_STREAM):\r\n  File \"/root/.pyenv/versions/3.6.0/lib/python3.6/socket.py\", line 743, in getaddrinfo\r\n    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):\r\nsocket.gaierror: [Errno -2] Name or service not known\r\n\r\n\r\n\r\n在本地用命令mail发送邮件可以,在config.py文件中的配置是这样的\r\n\r\n    EMAIL_HOST = 'stmp.sina.com'\r\n    EMAIL_PORT = 25\r\n    EMAIL_ENABLE = 1\r\n    EMAIL_HOST_USER = 'wocswang@sina.com'\r\n    EMAIL_HOST_PASSWORD = '**********'\r\n    EMAIL_USE_SSL = False\r\n    EMAIL_USE_TLS = False\r\n    EMAIL_SUBJECT_PREFIX = '[Jumpserver] '\r\n    SITE_URL = 'http://10.10.16.244:8080'\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jumpserver/jumpserver/issues/comments/337516317","html_url":"https://github.com/jumpserver/jumpserver/issues/767#issuecomment-337516317","issue_url":"https://api.github.com/repos/jumpserver/jumpserver/issues/767","id":337516317,"user":{"login":"wocswang","id":23565529,"avatar_url":"https://avatars1.githubusercontent.com/u/23565529?v=4","gravatar_id":"","url":"https://api.github.com/users/wocswang","html_url":"https://github.com/wocswang","followers_url":"https://api.github.com/users/wocswang/followers","following_url":"https://api.github.com/users/wocswang/following{/other_user}","gists_url":"https://api.github.com/users/wocswang/gists{/gist_id}","starred_url":"https://api.github.com/users/wocswang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wocswang/subscriptions","organizations_url":"https://api.github.com/users/wocswang/orgs","repos_url":"https://api.github.com/users/wocswang/repos","events_url":"https://api.github.com/users/wocswang/events{/privacy}","received_events_url":"https://api.github.com/users/wocswang/received_events","type":"User","site_admin":false},"created_at":"2017-10-18T09:09:16Z","updated_at":"2017-10-18T09:09:16Z","author_association":"NONE","body":"@hellorocky 我在命令行中用mail命令可以发送邮件"}}
{"actor":{"display_login":"wocswang"}}