Skip to content

plcouture/postfix-relay

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

postfix-relay

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

Usage

docker pull mwader/postfix-relay or clone and build it yourself. Default postfix is configured to be an open relay that rely on docker networking for firewalling. So be careful not to expose it publicly.

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.

Using docker run

docker run \
	-e POSTFIX_myhostname=smtp.domain.tld \
	--name smtp \
	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

SPF

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

DKIM

To enable DKIM specifying a white space separated list of domains in the environment variable OPENDKIM_DOMAINS. At container start key pairs for each domain will be generated if not found in /etc/opendkim/keys/<domain>. To persist the keys make sure to add a host directory volume for /etc/opendkim/keys. If your using docker-compose it will automatically take care of moving data volumes between container recreates.

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

License

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

Releases

No releases published

Packages

No packages published

Languages

  • Shell 61.2%
  • Dockerfile 38.8%