Add tests for smtp-relay.

* Send of unencrypted mail depending on 'encrypted_only' param.
* Malformed email address.

This closes #2446.