Commit 6bd7d079 by Alex Eftimie

Update README.md

parent 372beca9
# Postfix Image for SMTP Auth # Postfix Image for SMTP Auth
Build: This image is a CentOS 6 container running postfix preconfigured for SMTP relay authentication. It runs as an open relay mail server inside the Docker Containers internal network, so it can be used by any container to send emails through the remote relay.
docker build -t eeacms/postfix . The relay is set in the environment variable: `MTP_RELAY`.
Update the `.secrets` with your smtp authentication. The hostname of the postfix server is set in: `MTP_HOST`.
Usage: The `.secrets` file should be used as a runtime environment variables, and set the user and password required for SMTP authentication by the `MTP_RELAY`:
MTP_USER=user
MTP_PASS=password
Basic way to get one instance up and running:
docker run --rm -t -i --env-file=.secret --name=postfix eeacms/postfix docker run --rm -t -i --env-file=.secret --name=postfix eeacms/postfix
From the application container, running on the same docker host, one can set the SMTP server to the postfix container address.
d
## Example usage ## Example usage
In the `example` folder, there is an example centos container than can be used to test connectivity. In the `example` folder, there is an example centos container than can be used to test connectivity.
...@@ -29,4 +36,4 @@ In the `example` folder, there is an example centos container than can be used t ...@@ -29,4 +36,4 @@ In the `example` folder, there is an example centos container than can be used t
>>> import smtplib >>> import smtplib
>>> s = smtplib.SMTP('postfixcontainer') >>> s = smtplib.SMTP('postfixcontainer')
>>> s.sendmail('test@example.eionet.europa.eu', ['user@example.com'], 'test') >>> s.sendmail('test@example.eionet.europa.eu', ['user@example.com'], 'test')
{} {}
\ No newline at end of file
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