Skip to content

robtec/postfix-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Postfix Docker

Postfix inside a Docker Container

Setup

Add/update files/users.txt to control the system users created in the container

Build the image

docker build -t postfix-image .

Generate TLS Certificate using certbot

Install certbot on your host machine, ubuntu for example

Install Certbot

# update the following command with your domain then run

certbot certonly --standalone --preferred-challenges http -d ${MY_DOMAIN}

# follow prompts and note where the Certificate and Key is saved
# usually found in /etc/letsencrypt/live/${MY_DOMAIN}/

# docker will mount /etc/letsencrypt/ and use the cert/key

Running

# docker compose (preferred)

docker compose up -d --build

# docker

docker run -d -e "MY_DOMAIN=localhost" -v /etc/letsencrypt/:/etc/letsencrypt --name postfix-mail -it -p 25:25 postfix-image

Test

Using your own email client, send an email to $USER@{$MY_DOMAIN}

Docs

Postfixs main.cf can be found under files/main.cf

About

Postfix inside a Docker Container

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published