Last active
April 10, 2023 12:35
-
-
Save sz332/22878c7463ee68bdfb006a55bccc967a to your computer and use it in GitHub Desktop.
Greenmail and Thunderbird
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM openjdk:8-jre-alpine AS base | |
ENV GREENMAIL_OPTS -Dgreenmail.setup.test.all -Dgreenmail.hostname=0.0.0.0 -Dgreenmail.smtp.hostname=localhost -Dgreenmail.verbose | |
RUN apk add --no-cache curl | |
RUN curl -O http://central.maven.org/maven2/com/icegreen/greenmail-standalone/1.5.9/greenmail-standalone-1.5.9.jar | |
FROM openjdk:8-jre-alpine AS final | |
COPY --from=base /greenmail-standalone-1.5.9.jar /greenmail-standalone-1.5.9.jar | |
EXPOSE 3025 3465 3143 3993 3110 3995 | |
CMD /usr/bin/java $GREENMAIL_OPTS -jar greenmail-standalone-1.5.9.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Build: | |
docker build -t greenmail:latest . | |
Run: | |
docker run -t -i -p3025:3025 -p3110:3110 greenmail/latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java -Dgreenmail.smtp.hostname=localhost | |
-Dgreenmail.hostname=0.0.0.0 | |
-Dgreenmail.setup.test.smtp | |
-Dgreenmail.setup.test.pop3 | |
-Dgreenmail.users=aniko:12345@localhost,zsolt:12345@localhost | |
-Dgreenmail.verbose | |
-jar greenmail-standalone-1.5.9.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thunderbird: | |
Start thunderbird with profile (thunderbird -p) | |
Create a new profile with name aniko | |
aniko | |
aniko@localhost | |
12345 | |
smtp: 3025 localhost | |
pop3: 3110 localhost | |
Write an email to zsolt@localhost | |
Restart thunderbird with -p argument | |
Create a second profile with name zsolt | |
zsolt | |
zsolt@localhost | |
12345 | |
smtp: 3025 localhost | |
pop3: 3110 localhost | |
You will see a new email received | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If we have a windows host, and running the docker in a virtual machine, then the port forwarding | |
has to be set: | |
Protocol | Host IP | Host port | Guest ip | Guest port | |
TCP | 127.0.0.1 | 3025 | | 3025 | |
TCP | 127.0.0.1 | 3110 | | 3110 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment