How can we help you today?

How to Use MailHog on Hypernode

Created by: Sophie van Vrijberghe de Coningh

Modified on: Wed, 27 May, 2020 at 2:55 PM


Debugging outgoing mail issues could require you to inspect all outgoing mail from a webshop. With MailHog you can send out as many test emails as you’d like, none will reach your customers. MailHog is an email testing tool for developers to catch all these emails in a single mailbox.

Please note: any mail sent out while MailHog is activated will be consumed by MailHog. The emails caught by MailHog will not reach your customers. After MailHog is deactivated only the emails sent after deactivation will reach the customers.

TABLE OF CONTENTS

How to Activate Mailhog

To install MailHog on a Hypernode, MailHog first needs to be enabled. This can be done using the following command through the CLI.

hypernode-systemctl settings mailhog_enabled --value True

This will install and activate MailHog (might take a couple minutes).

How to Use Mailhog

After the setting is changed and the node is updated, all mail sent from the Hypernode will be caught in the MailHog mailbox. Mail will not reach customers anymore.

To access MailHog we need to link the  8025 port on the Hypernode to our own 8025 port. This can be done using a SSH connection. Enter the following command on the CLI on your local computer.

ssh app@appname.hypernode.io -L 8025:localhost:8025

This will forward localhost:8025 (where MailHog is running) to our local 8025  port. Now going to localhost:8025 in a browser will show the MailHog mailbox with all the mails it catches from the Hypernode.

How to Deactivate Mailhog

If you are using a development node, MailHog can keep running. If you used MailHog to test something on the production node, it needs to be turned off after use. Luckily this is as easy as turning MailHog on. Using the following command.

hypernode-systemctl settings mailhog_enabled --value False</code></pre>

Wait for the Hypernode to uninstall MailHog and restore all the normal mail settings (might take a couple minutes).

S
Sophie is the author of this solution article.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.