Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6917955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:47:51+00:00 2026-05-27T09:47:51+00:00

Obviously it’s not so difficult to send out emails from a Java EE application

  • 0

Obviously it’s not so difficult to send out emails from a Java EE application via JavaMail. What I am interested in is the best pattern to receive emails (notification bounces, mostly)? I am not interested in IMAP/POP3-based approaches (polling the inbox) – my application shall react to inbound emails.

One approach I could think of would be

  • Keep existing MTA (postfix on linux in my case) -> ops team already knows how to configure / operate it
  • For every mail that arrives, spawn a Java app that receives the data and sends it off via JMS. I could do this via an entry in /etc/aliases like myuser: "|/path/to/javahelper" with javahelper calling the Java app, passing STDIN along.
  • MDB (part of Java EE application) receives JMS message, parses it, detects bounce message and acts accordingly.

Another approach could be

  • Open a listening network socket on port 25 on the Java EE application container.
  • Associate a SessionBean with the socket. Bean is part of Java EE application and can parse/detect bounces/handle the messages directly.
  • Keep existing MTA as inbound relay, do all its security/spam filtering, but forward emails to myuser (that pass the filter) to the Java EE application container, port 25.

The first approach I have done before (albeit in a different language/setup).

From a performance and (perceived) cleanliness point of view, I think the second approach is better, but it would require me to provide a proper SMTP transport implementation. Also, I don’t know if it’s at all possible to connect a network socket with a bean…

What is your recommendation? Do you have details about the second approach?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:47:52+00:00Added an answer on May 27, 2026 at 9:47 am

    Perhaps SubEtha SMTP [edit: now relocated from Google Code to GitHub] would be of interest — it is a Java library that allows your application to receive SMTP mail. I’m about to try it out.

    Here’s a somewhat related Stack Overflow question (and someone suggests SubEthaSMP):
    What is the easiest way for a Java application to receive incoming email?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Obviously, Java doesn't support unsigned number types natively, and that's not going to change
Obviously, Java does not have delegates or functions as first class values and uses
Obviously there are security reasons to close a wireless network and it's not fun
Obviously, the actual style of the odd/even rows will be done via a CSS
Obviously, my desktop is not read-only, however stat() and findfirst() functions report this as
Obviously the reader doesn't like this format incoming from the response XML. Wondering if
Obviously, you can't push data to a web application, as HTTP works in a
Obviously java.lang.StrictMath contains additional functions (hyperbolics etc.) which java.lang.Math doesn't, but is there a
Obviously, it probably has some (or many) advantages over 32-bit that I'm clearly not
Obviously enough, I want to avoid hardcoding paths and such into my application, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.