pradex
pradex

Reputation: 348

How to enable applications to send email from google container engine

I am using a third party app in google container engine. It expects SMTP to be configured on default port(25) of localhost.

Since I cannot configure SMTP URL for the application and google cloud doesn't allow usage of SMTP ports, is there any way by which I can send emails from GKE.

Upvotes: 7

Views: 5558

Answers (1)

Sunil Kumar
Sunil Kumar

Reputation: 1711

If you are using Kubernetes, you can send mails by adding a sidekick Emailrelay container to your pod.

Emailrelay can run as-a-proxy. It listens on port 25 of localhost and forwards mails to an external SMTP server. It also supports authentication with outbound server and STARTTLS. Sample command will be like

emailrelay --no-daemon --as-proxy external.smtp.server:<PORT> --client-tls --client-auth /path/to/smtp/auth

Credentials file needs to be in format

LOGIN client username password

where, 'username' and 'password' should to be xtext encoded.

To overcome google cloud limitations, external server needs to accept SMTP requests on custom port.

Upvotes: 10

Related Questions