Commit 5909f323 by Alex Eftimie

Add example container that uses ssmtp to forward emails.

This will work for applications invoking /usr/bin/sendmail

It will not work for applications connecting directly to localhost:25.
parent 40487c49
...@@ -4,8 +4,20 @@ Build: ...@@ -4,8 +4,20 @@ Build:
docker build -t eeacms/postfix . docker build -t eeacms/postfix .
Edit the `.secrets` with your smtp authentication. Update the `.secrets` with your smtp authentication.
Usage: Usage:
docker run --rm -t -i --env-file=.secret eeacms/postfix docker run --rm -t -i --env-file=.secret --name=postfix eeacms/postfix
## Example usage
Run:
cd example
docker build -t example .
docker run --rm -it --link=postfix:postfixcontainer example
mail test@example.com
# mail should be sent by the postfix container
\ No newline at end of file
FROM layerworx/centos
RUN yum install -y mailx ssmtp
ADD ssmtp.conf /etc/ssmtp/ssmtp.conf
CMD ["bash"]
#
# /etc/ssmtp.conf -- a config file for sSMTP sendmail.
#
# See the ssmtp.conf(5) man page for a more verbose explanation of the
# available options.
#
# The person who gets all mail for userids < 500
# Make this empty to disable rewriting.
root=postmaster
# The place where the mail goes. The actual machine name is required
# no MX records are consulted. Commonly mailhosts are named mail.domain.com
# The example will fit if you are in domain.com and your mailhub is so named.
mailhub=postfixcontainer
# Where will the mail seem to come from?
#RewriteDomain=
# The full hostname
#Hostname=
# Set this to never rewrite the "From:" line (unless not given) and to
# use that address in the "from line" of the envelope.
FromLineOverride=YES
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment