Home

Awesome

Postfix Mail Relay

Simple SMTP relay, originally based on alterrebe/docker-mail-relay, but has been rewritten since.

Description

The container provides a simple SMTP relay for environments like Amazon VPC where you may have private servers with no Internet connection and therefore with no access to external mail relays (e.g. Amazon SES, SendGrid and others). You need to supply the container with your external mail relay address and credentials. The image is tested with Amazon SES, Sendgrid, Gmail and Mandrill

Changes since alterrebe/docker-mail-relay

Changed in version 1.3.0

Environment variables

ENV. VariableDescription
ACCEPTED_NETWORKSSpace delimited list of networks to accept mail from. <br/> Default: 192.168.0.0/16 172.16.0.0/12 10.0.0.0/8
RECIPIENT_RESTRICTIONSSpace delimited list of allowed RCPT TO addresses. <br/> Default: unrestricted
SMTP_HOSTExternal relay DNS name. <br/> Default: email-smtp.us-east-1.amazonaws.com
SMTP_LOGINLogin to connect to the external relay. <br/> Required
SMTP_PASSWORDPassword to connect to the external relay. <br/> Required
SMTP_PORTExternal relay TCP port. <br/> Default: 25
TLS_VERIFYTrust level for checking remote side cert. <br/> Default: may (http://www.postfix.org/postconf.5.html#smtp_tls_security_level)
USE_TLSRemote require tls. Must be yes or no. <br/> Default: no

Exposed port(s)

Postfix on port 25

Example

Launch Postfix container:

docker run -d -h relay.example.com --name="mailrelay" \
    -e RECIPIENT_RESTRICTIONS="gmail.com test@example.com" \
    -e SMTP_LOGIN=myLogin \
    -e SMTP_PASSWORD=myPassword \
    -p 25:25 \
    simenduev/postfix-relay