NOTE: This article is an INTERNAL article and is not visible to customers, currently. Please only link this article in internal comments, but not public comments.
Issue
- I want to test the behavior of the forgot password functionality after observing 404 errors for users trying to use the link generated to reset their password over email.
- In other words I need a way to intercept emails generated by the local bundle to test the links.
Environment
- Linux (though for Windows and macOS the steps are very similar see the documentation on the linked site in Step 3 below for details)
Resolution
How to Setup a Fake SMTP Server to Intercept Emails in a Local Bundle
1. Stop the bundle if it's currently running.
2. Add mail.send.blacklist= to the portal-ext.properties.
3. Go to http://nilhcem.com/FakeSMTP/ then download the latest version and extract the zip file.
4. Open in terminal the new extracted directory with the jar file inside and run:
sudo java -jar fakesmtp-2.0.jar
5. The mail server window should now launch and press Start to start the server.
6. Any emails generated from the bundle will now be intercepted by the server.
7. You can use the Last Message tab in the server window to view the contents of an email.
8. Closing the app window will stop the server or you can just press the Stop button.
Additional Information
Troubleshooting if Necessary:
- Check Control Panel > Configuration > Server Administration > Mail and confirm that the outgoing ports match the ones listed in the fake SMTP server. Defaults should be 25 and 110.
- Also, check the username and password are set.
Further: