This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes Bouncing mails & Java Mail API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Bouncing mails & Java Mail API" Watch "Bouncing mails & Java Mail API" New topic

Bouncing mails & Java Mail API

Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2591

If the Java mail is trying to send mail to non-existent mail ID say (or one which has mailbox full) what will happen? Will it try delivering that message for a specified time period? I am getting many error messages from my SMTP server saying - "SMTP; 550 Requested action not taken: mailbox unavailable"

Is it something that needs to be tweaked at SMTP level or can I do something to set Java mail API properties such that retry time is less. This problem is slowing down my system with too many open connections. I am wondering what I can do - though we do email ID validation, there is no way at the moment to see if mailbox is really available or not. What can I do here?

Any pointers, help would be highly appreciated.

- Manish
Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

If the Java mail is trying to send mail to non-existent mail ID say (or one which has mailbox full) what will happen?

It will be sent to a server for and (possibly) be returned.

SMTP doesn't include any standard mechanism to report delivery failure. This is deliberate; given the environment SMTP is supposed to work in (the internet) there is the very real posibility that a failure message will not be returned.

So you have two problems:
  • That no failure message will be returned
  • That, if a message is returned, you don't have a guarenteed way of correlating which message failed.

  • You can get round the second by setting flags in your mail and reading them from incoming mails. There is no solution to the first problem.

    JavaRanch FAQ HowToAskQuestionsOnJavaRanch
    I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
    subject: Bouncing mails & Java Mail API
    jQuery in Action, 3rd edition