kimsible / postfix-relay

Postfix SMTP relay docker image

Home Page:https://hub.docker.com/r/mwader/postfix-relay/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

postfix-relay

Postfix SMTP relay docker image. Useful for sending email without using an external SMTP server.

Default configuration is an open relay that relies on docker networking for protection. So be careful to not expose it publicly.

Usage

docker pull mwader/postfix-relay or clone/build it yourself.

All postfix configuration options can be set using POSTFIX_<name> environment variables. See Dockerfile for default configuration. You probably want to set POSTFIX_myhostname (the FQDN used by 220/HELO).

Note that POSTFIX_myhostname will change the postfix option myhostname.

Using docker run

docker run -e POSTFIX_myhostname=smtp.domain.tld mwader/postfix-relay

Using docker-compose

app:
  # use hostname "smtp" as SMTP server

smtp:
  image: mwader/postfix-relay
  restart: always
  environment:
    - POSTFIX_myhostname=smtp.domain.tld
    - OPENDKIM_DOMAINS=smtp.domain.tld

SPF

When sending email using your own SMTP server it is probably a good idea to setup SPF for the domain you're sending from.

DKIM

To enable DKIM, specify a whitespace-separated list of domains in the environment variable OPENDKIM_DOMAINS. The default DKIM selector is "mail", but can be changed to "<selector>" using the syntax OPENDKIM_DOMAINS=<domain>=<selector>.

At container start, RSA key pairs will be generated for each domain unless the file /etc/opendkim/keys/<domain>/<selector>.private exists. If you want the keys to persist indefinitely, make sure to mount a volume for /etc/opendkim/keys, otherwise they will be destroyed when the container is removed.

DNS records to configure can be found in the container log or by running docker exec <container> sh -c 'cat /etc/opendkim/keys/*/*.txt'.

License

postfix-relay is licensed under the MIT license. See LICENSE for the full license text.

About

Postfix SMTP relay docker image

https://hub.docker.com/r/mwader/postfix-relay/

License:MIT License


Languages

Language:Shell 67.3%Language:Dockerfile 32.7%