Sign inSign up

simenduev/postfix-relay

By simenduev

•Updated over 3 years ago

Simple SMTP relay for environments where you may have private servers with no Internet connection.

Image
6

500K+

simenduev/postfix-relay repository overview

⁠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 from alterrebe/docker-mail-relay

  • Uses alpine image instead of ubuntu.
  • Uses envsubst for templating instead of j2cli.
  • All output goes to stdout and stderr including maillog.
  • Included superviserd event watcher which will exit the supervisord process if one of the monitored processes dies unexpectedly.
  • Doesn't use TLS on smtpd side.
  • And other changes to make the image as KISS as possible

⁠Environment variables

ENV. VariableDescription
ACCEPTED_NETWORKSSpace delimited list of networks to accept mail from.
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.
Default: unrestricted
SMTP_HOSTExternal relay DNS name.
Default: email-smtp.us-east-1.amazonaws.com
SMTP_PORTExternal relay TCP port.
Default: 25
SMTP_LOGINLogin to connect to the external relay.
Required
SMTP_PASSWORDPassword to connect to the external relay.
Required
USE_TLSRemote require tls. Must be yes or no.
Default: no
TLS_VERIFYTrust level for checking remote side cert.
Default: may (http://www.postfix.org/postconf.5.html#smtp_tls_security_level⁠)

⁠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 [email protected]" \
    -e SMTP_LOGIN=myLogin \
    -e SMTP_PASSWORD=myPassword \
    -p 25:25 \
    simenduev/postfix-relay

Tag summary

Content type

Image

Digest

sha256:5c753ef73…

Size

8.5 MB

Last updated

over 3 years ago

docker pull simenduev/postfix-relay