Skip to content

Instantly share code, notes, and snippets.

@svetlyak40wt
Created February 7, 2016 14:38
Show Gist options
  • Save svetlyak40wt/460275b0077207e63173 to your computer and use it in GitHub Desktop.
Save svetlyak40wt/460275b0077207e63173 to your computer and use it in GitHub Desktop.
Using nullmailer from docker image
# this example shows how to run docker container and use nullmailer, running on a host machine
# first, run a container like that
sudo docker run \
--rm \
-ti \
-v `which sendmail`:`which sendmail` \
-v `which nullmailer-inject`:`which nullmailer-inject` \
-v `which nullmailer-queue`:`which nullmailer-queue` \
-v /etc/nullmailer:/etc/nullmailer \
-v /var/spool/nullmailer:/var/spool/nullmailer \
ubuntu:trusty \
bash
# and check how sendmail works inside the container
echo "Hello from container" | sendmail somebody@example.com
# it should be put into the /var/spool/nullmailer on the host machine
# and sent by daemon which runs on the host machine
@MedUnes
Copy link

MedUnes commented Mar 24, 2023

this requires the container to have sendmail installed

@svetlyak40wt
Copy link
Author

I believe ubuntu:trusty had sendmail installed out of the box.

@MedUnes
Copy link

MedUnes commented Apr 5, 2023

you are right, sorry didn't see the last line
ubuntu:trusty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment