Instanciate the SMTP class only when needed
instead of creating it in the VaultBackend constructor: when configured (with host and port), SMTP.connect() is immediately called, which makes it mandatory to have the smtp server up and running to be able to create the VaultBackend object (which makes it hard to run properly in an elastic environment like docker or k8s). This also removes the fallback to hardcoded 'localhost:25' smtp server; if the smtp server is not configured or not reachable, the call to _smtp_send() will fail logging the failure (both in logging and sentry).
parent
ee678042
No related branches found
No related tags found