Public Repository

Last pushed: a year ago
Short Description
"SMTP Only" postfix image
Full Description

a simple "SMTP Only" postfix image.

Emails can be send from any private network address:

  • 127.0.0.1/32
  • 192.168.0.0/16
  • 172.16.0.0/12
  • 10.0.0.0/8

Start the image and include your (docker) hosts DNS entry. e.g.

docker run -d --name postfix -p 25:25 --restart always yorkshirekev/postfix mail.example.com

Source-code for this image is on GitHub: https://github.com/YorkshireKev/docker-postfix

Docker Pull Command
Owner
yorkshirekev

Comments (2)
tosoboso
a year ago

In your Docker image (and others) postfix status and stop is not working. I had same issues and I'm happy to share the solution:
Consider adding the following lines to your docker init-file to get postfix service status and stop working.
'# adjust postfix status in init-file for docker as even root does not have acl to read from /proc/$PPID/exe
if [ ! -e /etc/init.done ] ; then
sed -i -e 's~dir=$(ls -l /proc/$pid/exe~pgrep -f /usr/lib/postfix -s "$pid" \&\& echo y || true \n\t#dir=$(ls -l /proc/$pid/exe~' /etc/init.d/postfix
touch /etc/init.done
fi

Now you can also replace in init-file the tail -f by a verification loop that postfix is running or else terminate the docker container:
while service postfix status | grep -q "postfix is running" ; do sleep 10 ; done
echo "exiting as postfix service failed to run"

yorkshirekev
3 years ago

Updated image - To allow mail to also be sent to addresses at the same domain as postfix is running; e.g. someone@mail.example.com if the postfix server was running at mail.example.com