*
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Bouncing mails & Java Mail API" Watch "Bouncing mails & Java Mail API" New topic
Author

Bouncing mails & Java Mail API

Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2578

If the Java mail is trying to send mail to non-existent mail ID say xyz@pqr.com (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
Bartender

Joined: Apr 14, 2004
Posts: 10336


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

It will be sent to a server for pqr.com 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
     
    Don't get me started about those stupid light bulbs.
     
    subject: Bouncing mails & Java Mail API