Toggle menu

Emails from Non-Production Environments

Despite being a bit rubbish, email is still one of the main ways people receive information from web based services. In non-production environments, whether development, test or pre-production, developers need to be able to see and test the emails that will be sent to real users, without the risk of those emails being sent out to the public. This risk is exacerbated by the fact that some non-production environments may contain real user data and active process instances, copied across should a database be restored from a live production server.

Rather than hooking internal environments up to public mail servers, we provide an SMTP testing service that captures emails. GOSS staff and client developers can log into the web-based UI and view the captured mail.

MailHog

MailHog is an open source SMTP testing service released under the MIT license.

In our hosting infrastructure we create a contained instance of MailHog for each non-production environment that needs to use a mail server (in practice that's all of them). Each MailHog instance has two ports, one for HTTP access, the other for SMTP. That means if we host your test, development and pre-production environments, you'll have three separate instances of MailHog. Each environment will be set up to use it's MailHog instance instead of our usual mail servers.

Configuring iCM

In our hosting infrastructure all environment variables are stored in a centrally managed repository. If you make any changes to the platform's configuration, let someone in our support or hosting teams know.

Mail server details are held in iCM's autoconfig, in the format <smtpserver>:<smtpport>. For example, tstsmtp1.ipa.int.storm50.com:2501.

When changes are made in autoconfig you must resend the configuration files to all of your API Servers. As well as the information in the iCM-managed config files, your API Servers are also passed environment information, including which mail server to use.

The Email worker can also be configured to use a specific mail server, rather than the platform's default. Double check the SMTPServer property in the config file your API Servers are using (in most cases this property won't be set and the Email worker will be using the default).

You've Got Mail

Our hosting team will set up MailHog instances for you and configure your non-production environments to use them. Once set up we'll let you know the URLs and the username and password for logging in.

Currently you'll have a single user for each instance, which you'll need to share between your developers - we're looking at ways to manage individual users or provide access in a different way.

Emails are kept in memory, not long-term storage. This means data will be lost when the service is restarted. Do not expect to see historic emails, you should be using MailHog to test the service you are currently working on.

It's not possible to forward emails from MailHog. We've designed this service to be transient, minimising any potential for personal data to be propagated to systems that are not properly managed and audited. However be aware that there could be a period of several weeks when data, including personal data should it be present in your emails, is stored in your MailHog instance.

GOSS Staff

There's a more technical article on the intranet which explains how to set up MailHog instances.

Last modified on 13 June 2019

Share this page

Facebook icon Twitter icon email icon

Print

print icon