my dog learned polymorphism*
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 Android Security Essentials Live Lessons this week in the Android forum!
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: 2578

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 agree. Here's the link:
    subject: Bouncing mails & Java Mail API
    Similar Threads
    Java Mail API Beginner Question
    JavaMail e-mail goes to Junk E-mail
    JAVA Mail API (Expert opinion needed)
    How can i get the read receipt
    SMTP protocol : please help !