Docker image for E-MailRelay (dcagatay/emailrelay)
Available Tags:
latest
,2.6
2.5.2
2.5.1a
2.5.1
2.5
2.4.1
2.4
2.3
Alpine based Docker image for E-MailRelay. You can find more on its website.
Container configuration is done via environment variables and command line arguments. Command line arguments are given directly to emailrelay
executable.
To see all command line options of emailrelay
command:
docker run --rm dcagatay/emailrelay --help --verbose
Some usage examples are given in docker-compose.yml
.
Sample configuration for sending emails from your Gmail account.
Add your credentials to client-auth.txt
.
client plain [email protected] gmail-or-app-password
Run the docker container
docker run --rm \
-p "25:25" \
-v "$PWD/client-auth.txt:/client-auth.txt" \
dcagatay/emailrelay --forward-on-disconnect --forward-to smtp.gmail.com:587 --client-tls --client-auth=/client-auth.txt
By default the following arguments are given on runtime. You can overwrite DEFAULT_OPTS
environment variable to change or disable this behaviour.
--no-daemon --no-syslog --log --log-time --remote-clients
The port that E-MailRelay runs on. Default value is 25
. If you did TLS configuration you need to set this variable to 587
or something else.
Spool directory for E-MailRelay. No need to change. Default value: /var/spool/emailrelay
This variable is used to give options to swaks, it is used on built-in health-check functionality. If you serve with TLS configuration you need to set this variable to -tls
. Default value: empty-string
Inside config
directory you will find sample files for usage with filter functionality, SMTP client authentication and relay server authentication.
For any further configuration or details, refer to the E-MailRelay documentation.
You can test your configuration with swaks.
echo "This is a test message." | swaks --to [email protected] --from [email protected] --server emailrelay --port 9025
Or use a container, after running the containers in docker-compose.yml
you could run the following command to test with swaks and see the test email on localhost:8025.
docker-compose run \
--entrypoint /bin/sh \
emailrelay \
-c 'echo "This is a test message." | swaks --to <[email protected]> --from <[email protected]> --server emailrelay --port 25'
- E-MailRelay version upgrade(s).
- Smaller container images.
- Included
bash
shell for further scripting. - Default TLS configuration is changed to insecure configuration.
- Sample files for advanced configuration.