How to: AWS SMTP / Azure SMTP for mailers configuration

Hello Community,

I have gone through the configuration samples and help topics to find if there is a way to use third party smtp credentials in HAProxy to generate alert. However I ended up being unable to figure out.

Could anyone of you please help with this?

Unfortunately, based on the available documentation, the HAProxy mailers do not support authentication (any kind of authentication). However, at least AWS, the cloud based email services do require at least username / password authentication. Thus using AWS or Azure as direct SMTP servers for HAProxy is not possible.

I investigated exactly this issue a few weeks ago, and found no simple or safe way to do this… Most suggest setting-up Postfix, accepting unauthenticated email only from localhost, and forwarding it through the cloud provider SMTP endpoint (with authentication).

Another close enough alternative would be nullmailer ([untroubled.org: nullmailer] or [nullmailer - Debian Wiki]) however as it was not available on openSUSE I didn’t try it.

Alternatively, and I’ve thought of this but didn’t manage to implement it yet, one could implement a very simple SMTP server in Go / Python / something-else that just speaks enough SMTP to make HAProxy happy, and then take the email payload and forward it with the help of a normal SMTP library for that language.

1 Like

Thanks. This has a lot of information.