{"action":"created","issue":{"url":"https://api.github.com/repos/anoved/OctoPrint-EmailNotifier/issues/10","repository_url":"https://api.github.com/repos/anoved/OctoPrint-EmailNotifier","labels_url":"https://api.github.com/repos/anoved/OctoPrint-EmailNotifier/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/anoved/OctoPrint-EmailNotifier/issues/10/comments","events_url":"https://api.github.com/repos/anoved/OctoPrint-EmailNotifier/issues/10/events","html_url":"https://github.com/anoved/OctoPrint-EmailNotifier/issues/10","id":133938413,"number":10,"title":"password for encrypted keyring","user":{"login":"GeorgHo","id":17269049,"avatar_url":"https://avatars.githubusercontent.com/u/17269049?v=3","gravatar_id":"","url":"https://api.github.com/users/GeorgHo","html_url":"https://github.com/GeorgHo","followers_url":"https://api.github.com/users/GeorgHo/followers","following_url":"https://api.github.com/users/GeorgHo/following{/other_user}","gists_url":"https://api.github.com/users/GeorgHo/gists{/gist_id}","starred_url":"https://api.github.com/users/GeorgHo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GeorgHo/subscriptions","organizations_url":"https://api.github.com/users/GeorgHo/orgs","repos_url":"https://api.github.com/users/GeorgHo/repos","events_url":"https://api.github.com/users/GeorgHo/events{/privacy}","received_events_url":"https://api.github.com/users/GeorgHo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-16T10:16:08Z","updated_at":"2016-02-17T03:05:39Z","closed_at":null,"body":"Hi all,\r\nI get this error in the log:\r\n\r\n`2016-02-15 19:58:01,490 - py.warnings - WARNING - /usr/lib/python2.7/getpass.py:83: GetPassWarning: Can not control echo on the terminal.\r\n  passwd = fallback_getpass(prompt, stream)\r\n\r\n2016-02-15 19:58:01,491 - octoprint.plugins.emailnotifier - ERROR - Email notification error: \r\nTraceback (most recent call last):\r\n  File \"/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/octoprint_emailnotifier/__init__.py\", line 72, in on_event\r\n    mailer = yagmail.SMTP(user={self._settings.get(['mail_username']):self._settings.get(['mail_useralias'])}, host=self._settings.get(['mail_server']))\r\n  File \"/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/yagmail/yagmail.py\", line 68, in __init__\r\n    self.login(password)\r\n  File \"/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/yagmail/yagmail.py\", line 178, in login\r\n    password = self.handle_password(password)\r\n  File \"/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/yagmail/yagmail.py\", line 140, in handle_password\r\n    password = keyring.get_password('yagmail', self.user)\r\n  File \"/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/keyring/core.py\", line 42, in get_password\r\n    return _keyring_backend.get_password(service_name, username)\r\n  File \"/usr/local/lib/python2.7/dist-packages/keyrings/alt/file.py\", line 79, in get_password\r\n    password = self.decrypt(password_encrypted).decode('utf-8')\r\n  File \"/usr/local/lib/python2.7/dist-packages/keyrings/alt/file.py\", line 290, in decrypt\r\n    cipher = self._create_cipher(self.keyring_key, data['salt'],\r\n  File \"/home/pi/OctoPrint/venv/local/lib/python2.7/site-packages/keyring/util/properties.py\", line 52, in __get__\r\n    return self.fget(obj)\r\n  File \"/usr/local/lib/python2.7/dist-packages/keyrings/alt/file.py\", line 217, in keyring_key\r\n    self._unlock()\r\n  File \"/usr/local/lib/python2.7/dist-packages/keyrings/alt/file.py\", line 256, in _unlock\r\n    'Please enter password for encrypted keyring: ')\r\n  File \"/usr/lib/python2.7/getpass.py\", line 83, in unix_getpass\r\n    passwd = fallback_getpass(prompt, stream)\r\n  File \"/usr/lib/python2.7/getpass.py\", line 118, in fallback_getpass\r\n    return _raw_input(prompt, stream)\r\n  File \"/usr/lib/python2.7/getpass.py\", line 135, in _raw_input\r\n    raise EOFError\r\nEOFError`\r\n\r\n\r\nIf I use this in the console, everything works fine and I received a mail;\r\n~/OctoPrint/venv/bin/python\r\nimport yagmail\r\nyagmail.SMTP('XYZ@gmail.com').send('georg@hoXYZ.com', 'Test2', 'Mail von OctoPrint')\r\n\r\n\r\nWhat can I do to make it work?\r\nWhere can I take in the plugin the password for the encrypted keyring?\r\n\r\nThanks for the help\r\nGeorg"},"comment":{"url":"https://api.github.com/repos/anoved/OctoPrint-EmailNotifier/issues/comments/184991341","html_url":"https://github.com/anoved/OctoPrint-EmailNotifier/issues/10#issuecomment-184991341","issue_url":"https://api.github.com/repos/anoved/OctoPrint-EmailNotifier/issues/10","id":184991341,"user":{"login":"anoved","id":317994,"avatar_url":"https://avatars.githubusercontent.com/u/317994?v=3","gravatar_id":"","url":"https://api.github.com/users/anoved","html_url":"https://github.com/anoved","followers_url":"https://api.github.com/users/anoved/followers","following_url":"https://api.github.com/users/anoved/following{/other_user}","gists_url":"https://api.github.com/users/anoved/gists{/gist_id}","starred_url":"https://api.github.com/users/anoved/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anoved/subscriptions","organizations_url":"https://api.github.com/users/anoved/orgs","repos_url":"https://api.github.com/users/anoved/repos","events_url":"https://api.github.com/users/anoved/events{/privacy}","received_events_url":"https://api.github.com/users/anoved/received_events","type":"User","site_admin":false},"created_at":"2016-02-17T03:05:39Z","updated_at":"2016-02-17T03:05:39Z","body":"Hi Georg, I think the problem is yagmail is trying to interactively prompt you for you email password. This works during a console session but fails in the context of an Octoprint plugin since there's no terminal prompt available.\r\n\r\n[Here](https://github.com/kootenpv/yagmail#username-and-password) is how to save your login so yagmail can look it up:\r\n\r\n```\r\n~/OctoPrint/venv/bin/python\r\nimport yagmail\r\nyagmail.register('georg@hoXYZ.com', 'PASSWORD')\r\n```"}}