This Docker image is an extension of the srnjak-dev-playground
image, providing additional support for sending emails from the bash console using Postfix and Mailutils.
docker build -t srnjak-dev-playground-mail .
To run the container, you can use either the --env-file
option or the -e
flag to specify environment variables directly.
Below are examples for both methods:
docker run --env-file env.list -it srnjak-dev-playground-mail
Ensure that you have an env.list
file containing the necessary environment variables for email configuration, including RELAY_HOST
, USERNAME
, and PASSWORD
. Here is an example env.list
file:
RELAY_HOST="[mail.example.com]:465"
USERNAME="your_username"
PASSWORD="your_password"
docker run -e RELAY_HOST="[mail.example.com]:465" -e USERNAME="your_username" -e PASSWORD="your_password" -it srnjak-dev-playground-mail
Replace the values in quotes with your specific configuration details.
Once the container is running, you can send a test email using the following command:
echo "Test message" | mail -s "Test" -a "From: sender@example.com" recipient@example.com
Replace recipient@example.com
with the desired recipient's email address, and update the "From: sender@example.com"
to specify the desired sender's email address.
- Based on the
srnjak-dev-playground
image - Postfix
- Mailutils
The Docker image is available on Docker Hub:
This Docker image is licensed under the MIT License.