<h3>webdevops/postfix</h3>
Based on the <span class=”identifier”>webdevops/base</span> image the <span class=”identifier”>webdevops/postfix</span> image provides a simple to use mailing (MTA) service. The difference between the base image and the postfix image is only some simple provisioning with environment variables.
<h3>webdevops/mail-sandbox</h3>
Based on the <span class=”identifier”>webdevops/postfix</span> image this image provides a fully configured postfix which catches all ingoing emails and develiers them to a local mailbox. All mails of this mailbox can be accessed via Dovecot IMAP service.

If you want to install a email sandbox service eg. for development you can use this docker image to provide an easy way to collect all mail.
Use iptables rules to redirect all outgoing mails to the mail-sandbox container:
<pre class=”lang:sh decode:true “>OUTGOING_IP=192.168.56.100
DOCKER_SANDBOX_IP=192.168.56.101

iptables -t nat -A OUTPUT -p tcp –dport 25 -j DNAT –to-destination $DOCKER_SANDBOX_IP:25
iptables -t nat -A OUTPUT -p tcp –dport 587 -j DNAT –to-destination $DOCKER_SANDBOX_IP:25

iptables -t nat -I PREROUTING 1 -p tcp –dport 25 -j DNAT –to-destination “$OUTGOING_IP”
iptables -t nat -I POSTROUTING 1 -p tcp -d “$OUTGOING_IP” –dport 25 -j MASQUERADE

iptables -t nat -I PREROUTING 1 -p tcp –dport 587 -j DNAT –to-destination “$OUTGOING_IP:25”
iptables -t nat -I POSTROUTING 1 -p tcp -d “$OUTGOING_IP” –dport 587 -j MASQUERADE</pre>
&nbsp;