DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Data Engineering
  3. AI/ML
  4. Testing Email Notifications with Apache James 3.0

Testing Email Notifications with Apache James 3.0

Gunnar Hillert user avatar by
Gunnar Hillert
·
Jan. 02, 12 · Interview
Like (0)
Save
Tweet
Share
9.12K Views

Join the DZone community and get the full member experience.

Join For Free

On windows machines I have been using Mailster for testing email notifications. Unfortunately, I had issues with Mailster in the past running on non-Windows machines. Thus, on Mac I have been using a local Postfix instance, which forwarded email to dedicated (real) mailboxes. But, it involved a bit of customization and ultimately I had to "know" to which mailboxes I wanted to send notifications to.

However, ideally I don't really care about email addresses. Instead I typically want to verify that the format and layout of the generated emails are good, be it text emails ort Html emails. Ultimately, it would be nice, if for testing, all notification sent ended up in ONE mailbox for development testing purposes.

Enter Apache James. Not long ago I came across this wonderful blog posting below about using Apache James 2.x in order to test application email notifications:


http://livingtao.blogspot.com/2007/05/testing-application-generated-emails.html

IT is amazing to see that this is pretty much the only dedicated blog posting on the internet regarding a seemingly very common issue. You would think that almost every serious enterprise application has to sent out email notifications, and be it solely for the "forgot password" feature. What is so fantastic about using Apache James, is that it allows you to test Email notifications, while sitting on a plane with no internet in sight. Just run everything locally.

Anyway, the steps illustrated in the blog above also work nicely for James 3.0 (currently milestone 2). What is pretty cool about Apache James is that it is now Spring-based :-)

Here are the simple steps to get things set up for Apache James 3.0:

  • Download Apache James 3.0
  • Unzip the downloaded archive
  • Edit mailetcontainer.xml in directory /conf/
  • Search for "<processor name="transport">"
  • Replace the entire element that starts with "<mailet match="All" class="RemoteDelivery">" with: "<mailet match="All" class="Forward">    <forwardto>test@localhost</forwardto></mailet>"
  • Startup Apache James 3.0 using sudo /bin/run.sh (Sudo is needed for local permissions)
  • Connect via Telnet to Apache James using:  telnet localhost 4555 (User: root password: root)
  • Type: adduser test test <return>
  • Setup Thunderbird (or your favority email application)




I hope this gives you enough starting points for setting up email notification testing. Please leave comments  if you see areas I can improve upon. Onward...

 

From http://hillert.blogspot.com/2011/05/testing-email-notifications-with-apache.html

application Testing Development testing Blog Machine Telnet Internet (web browser) Archive

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • How to Submit a Post to DZone
  • REST vs. Messaging for Microservices
  • HTTP vs Messaging for Microservices Communications
  • Spring Boot, Quarkus, or Micronaut?

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: