kootenpv / yagmail

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

Using encrypted kering(yagmail.register) in production mode? #58

Open DanielTimLee opened 8 years ago

DanielTimLee commented 8 years ago

What I understand with keyrings,

Normally, in production environment (such as Ubuntu 16.04 without X11) those environment might not have such kerying backends.

So, in these case, in yagmail recommends for keyrings.alt for one of keyring backend which is implemented by python.

But in this case, If I try to call yagmail.register , it keeps to pop-up prompt's with encrypted keyrings (such like this one)

Warning: Password input may be echoed.
Please enter password for encrypted keyring:

I think i understood why those password prompts are keep asking me for password (to securely store password managed by OS , such as mac's keychain or Kde's KWallet (or Kleopatra))

So, It is totally legit (fine) for asking password when we access those keyrings.

But, If in production mode (deploying web-server application), we might demonize the process and manage them with system & service manager. (such as systemctl or systemd)

And in this case, the process will be run in daemon, so no one can input that ecrypted keyring password!!

  1. Is there are any possible ways to pass the password for encrypted keyring password with using yagmail.register in production mode? (When in Demonized process)

    • One solution is not using yagmail.register and use yagmail.smtp(), but I really won't look foward to use this solution...
  2. In Production mode, How people usually implements with these yagmail register thing?