Sign inSign up

b32147/mail-relay

By b32147

Updated about 9 years ago

Runs an SMTP relay to forward local emails to a remote SMTP service, such as AWS SES.

Image
2

100K+

b32147/mail-relay repository overview

Postfix Mail Relay

Contains:

  • Postfix, running in a simple relay mode
  • RSyslog

Processes are managed by supervisord, including cronjobs

The container provides a simple proxy 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 configuration is tested with Amazon SES.

Exports

  • Postfix on 25

Variables

  • RELAY_HOST_NAME=relay.example.com: A DNS name for this relay container (usually the same as the Docker's hostname)
  • ACCEPTED_NETWORKS=192.168.0.0/16 172.16.0.0/12 10.0.0.0/8: A network (or a list of networks) to accept mail from
  • EXT_RELAY_HOST=email-smtp.us-east-1.amazonaws.com: External relay DNS name
  • EXT_RELAY_PORT=25: External relay TCP port
  • SMTP_LOGIN=: Login to connect to the external relay (required, otherwise the container fails to start)
  • SMTP_PASSWORD=: Password to connect to the external relay (required, otherwise the container fails to start)
  • USE_TLS=: Remote require tls. Might be "yes" or "no". Default: no.
  • TLS_VERIFY=: Trust level for checking the remote side cert. (none, may, encrypt, dane, dane-only, fingerprint, verify, secure). Default: may.

If using Docker Secrets, format the value of the env variable as:

  • SMTP_LOGIN={{DOCKER-SECRET:smtp-login}}

where 'smtp-login' is the name of the secret created in Docker. This will find that secret's file and expand its content to the original env variable. The secret's value will NOT be viewable within 'docker inspect' and would only be available within the running container.

Example

Launch Postfix container:

$ docker run -d -h relay.example.com --name="mailrelay" -e SMTP_LOGIN=myLogin -e SMTP_PASSWORD=myPassword -p 25:25 alterrebe/postfix-relay

Tag summary

Content type

Image

Digest

Size

20.3 MB

Last updated

about 9 years ago

docker pull b32147/mail-relay