Skip to content

Latest commit

 

History

History
40 lines (36 loc) · 1.14 KB

README.md

File metadata and controls

40 lines (36 loc) · 1.14 KB

kubernetes-postfix-relay-host

A SMTP relay host for transactional based emails from within a k8 cluster.

Overview

This repository contains Kubernetes config files and a docker image to easily set up a SMTP relay for services such as SendGrid.

Background

We needed a simple docker image that can be configured with env vars. Also, the functionality is easily overridded by providing an alternate init script.

Quickstart

Run on docker

docker run --rm -it -p 2525:25 \
	-e TX_SMTP_RELAY_HOST="[smtp.sendgrid.net]:587" \
	-e TX_SMTP_RELAY_MYHOSTNAME=tx-smtp-relay.yourhost.com \
	-e TX_SMTP_RELAY_USERNAME=username \
	-e TX_SMTP_RELAY_PASSWORD=password \
	applariat/tx-smtp-relay

Send a test message

telnet localhost 2525
220 tx-smtp-relay.yourhost.com ESMTP Postfix
helo localhost
250 tx-smtp-relay.yourhost.com
mail from: [email protected]
250 2.1.0 Ok
rcpt to: [email protected]
250 2.1.5 Ok
data
354 End data with .
Subject: What?
My hovercraft is full of eels.
.
250 2.0.0 Ok: queued as 982FF53C
quit
221 2.0.0 Bye
Connection closed by foreign host