saltstack/salt — pull request #9832 by danieljn (2014-01-18 21:47:14+00:00)
Title: Some fixes and the addition of GnuPG to smtp_return

I fixed some minor bugs present in this returner, and I also added some basic GnuPG encryption to it. Its implementation rather straigthforward. A more sophisticated solution may add the option to sign.
I have used it for a while know and it does not cause any problems.

Some details:
* The new setting, gpgowner, refers to the user whose ~/.gnupg directory contains a public key matching the receipient
* It adds python-gnupg as a dependency. I have no idea if this is part of the standard python distribution or if this is a dealbreaker to you.
* I set gnupg's trust setting to always, as the public key is intended for automated distribution and use. You could probably use default trust settings too, but I thought that this will suffice if you just want to grab the public key from a keyserver (using a state for example) and don't want to bother with generating a keyring/ trusting this key with your account.

I would at least recommend the other commits fixing bugs, but I would welcome GnuPG support in this returner.

Some other loosely related, major and possibly stuff-breaking changes I will leave to a developer knowing the consequences:
* indenting the server.login(user, pass) function near the end of this file by four spaces (i.e. make plaintext authentication impossible)
* making the configuguration for this returner a dict. That means:
```
smtp:
- host: bla
- user: bla
```
rather than:
```
smpt.host: bla
smtp.user: bla
```