This lesson is part of the Ignition with Docker course. You can browse the rest of the lessons below.


Autoplay Off


Follow along as we add an SMTP server to our testing environment.


(open in window)

[00:00] In this lesson, we'll continue building out our development environment within our Docker Compose stack. So far, we've created two Ignition gateways that are linked via a Gateway Network connection, and we've added a database that's connected to our backend gateway. All that's left for us is to add an SMTP server to test emails. Let's start by going to Docker Hub and searching for SMTP. We're going to include MailCatcher by Dockage, which we can see is a trusted image as part of the Docker Open Source Software Program. MailCatcher is going to act as our SMTP server and it will simply catch any of the messages that are sent to it and then we can view them in our web browser. Let's head over to our docker compose file and add another service. We can call this "smtp" and we'll use the dockage/mailcatcher image. And then the tag will be the most recent minor version which at the time of this recording is 0.8.2. Let's go ahead and expose ports 1080 and 1025. 1080 is going to be the web interface where we view the messages and 1025 will be where the messages are sent.

[01:09] The last part of this will be to add it to our backend network and we can give it an alias of "mail-server". Now we can save our file and run another "docker compose up" command. Once this is up and running we can launch the web interface. This will be on port 1080 of our host machine so it can be accessed via localhost, a wild card DNS resolver, or any other domain name you've set up for it. Once we access it, it allows us to see the messages that are sent to port 1025. Now we can set up an SMTP profile in Ignition. So let's head over to our backend gateway, which is where we're connecting the SMTP server, and create a new profile.

[02:09] We can name this SMTP and then for the hostname type in our network alias, which is "mail-server". For the port change this to 1025 and then we can go ahead and click create. We have the ability to click the more button here and select test from the drop-down. Then we can fill in some text for our example email and click. Send test email. We see a message down here that the email was sent. And now when we go to our MailCatcher web interface we can view our message. Now we have a working SMTP profile that's available for testing and if we wanted we could connect this to a notification profile for alarming or whatever else we wanted to test. If we refer back to our architecture diagram, we see that we have each component and our testing environment is now complete. We'll end this lesson but in the next one, I'll go over one additional step that will allow us to add another level of persistence to our environment.

You are editing this transcript.

Make any corrections to improve this transcript. We'll review any changes before posting them.