kootenpv / yagmail

Send email in Python conveniently for gmail using yagmail
MIT License
2.66k stars 265 forks source link

keyring for Rasberry Pi? #47

Open rogerjbos opened 8 years ago

rogerjbos commented 8 years ago

Does the keyring feature work on a rasberry pi? I have tried it on two of them and get the same error about no backend. How do I install a backend? pip import keyring shows keyring is installed. yagmail works great if I put the password in the script, but if I try to use yagmail.register or yagmail.SMTP() without a password I get the following error:

File "yag.py", line 2, in yagmail.SMTP('rjbos2@gmail.com') File "/usr/local/lib/python2.7/dist-packages/yagmail/yagmail.py", line 63, in init self.login(password) File "/usr/local/lib/python2.7/dist-packages/yagmail/yagmail.py", line 173, in login password = self._handle_password(password) File "/usr/local/lib/python2.7/dist-packages/yagmail/yagmail.py", line 137, in _handle_password password = keyring.get_password('yagmail', self.user) File "/usr/local/lib/python2.7/dist-packages/keyring/core.py", line 42, in get_password return _keyring_backend.get_password(service_name, username) File "/usr/local/lib/python2.7/dist-packages/keyring/backends/fail.py", line 18, in get_password raise RuntimeError("No recommended backend was available. Install the " RuntimeError: No recommended backend was available. Install the keyrings.alt package if you want to use the non-recommended backends. See README.rst for details.

A-Shleifman commented 8 years ago

If you install keyrings.alt it will fix the problem, but it requires to enter a "master" key manually, so I don't know how to use keyrings.alt in a python script without revealing the "master" key.

sudo pip install keyrings.alt sudo pip3 install keyrings.alt

ManuGithubSteam commented 7 years ago

keyrings. alt does not work anymore.

Any other solutions ? Thanks!

kootenpv commented 7 years ago

@ManuGithubSteam I've started using OAuth2 recently, you can read about it in the readme :)

ManuGithubSteam commented 7 years ago

Hi I did also use OAuth2 and made a credestial for it. When i try so send a testmail from octoprint it says:

Sending failed. Reason:: global name 'keyring' is not defined

So it want a keyring but the keyring.alt package does not exist for raspi anymore....

Any ideas ?

Thanks

maxiedaniels commented 6 years ago

Anyone figure this out??

ManuGithubSteam commented 6 years ago

Hi

I figured it out. I had to change some config line in the yagmail config i believe. But i dont remeber it. It is here in Github somewhere related to this project or octoprint.