Legacy Knowledge Base
Published Jul. 2, 2025

Fake SMTP Server for Local Bundle Email Interception

Written By

Kenny Back

How To articles are not official guidelines or officially supporteddocumentation. They are community-contributed content and may not alwaysreflect the latest updates to Liferay DXP. We welcome your feedback toimprove How to articles!

While we make every effort to ensure this Knowledge Base is accurate, itmay not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with anyfeedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack"publication program, made available for informational purposes. Articlesin this program were published without a requirement for independentediting or verification and are provided "as is" withoutguarantee.

Before using any information from this article, independently verify itssuitability for your situation and project.

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:

Configuring the Built-in Mail Session 

Did this article resolve your issue ?

Legacy Knowledge Base