Sets up a postfix email server that catches all emails received on port 25. Latest image can be found @ Docker Hub
Build docker image
docker build --tag email_server_image .
Run docker image
docker run -td -p 25:25 --name email_server_container email_server_image
Telnet to container at port 25
telnet localhost 25
Then type
MAIL FROM:<test@example.com>
RCPT TO:test@example.com
DATA
SUBJECT: test
Test email content
.
Attach to running container
docker exec -it email_server_container /bin/bash
View contents of /var/mail/recipient
cat /var/mail/recipient