aspose file tools*
The moose likes Java in General and the fly likes How to identify received mail is failure delivery notice mail in javamail?   Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

How to identify received mail is failure delivery notice mail in javamail?

Satheeshkumar Subramaniam
Greenhorn

Joined: Jul 06, 2009
Posts: 21


Hi friends,

My requirement is that i have to identify failure delivery notice mails while receiving mails through javamail api pop3..
Is there anyway to idenity those among normal mails?

looking forward your replies dudes...
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
if delivery fails, you get an email back from the targeted server saying that your email could not be delivered...

can't you just check your incoming mails for the 'mail delivery failed' template text ?


JDBCSupport - An easy to use, light-weight JDBC framework -
Satheeshkumar Subramaniam
Greenhorn

Joined: Jul 06, 2009
Posts: 21
Hi Sebastian Janisch,

what do you mean by 'mail delivery failed' template text ? you mean the subject 'failure notice' i received means ,anyone can send mail with subject 'failure notice' na?
Sebastian Janisch
Ranch Hand

Joined: Feb 23, 2009
Posts: 1183
hey,

i just sent an email into the nirvana to check ...

i was wrong about the failure notice, it is not the targeted server but the email server you send the mail from, which in my case was mailer-deamon@googlemail.com and in your case makes things easierm since you just need to check for that sender and the pattern of the failure message which i believe is up to the email server and in my case looked like this

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42608
    
  65
You can look for some specific phrases that typically occur in bounced mails, such as "invalid account", "user unknown", "account limit (or quota) exceeded" etc.


Ping & DNS - my free Android networking tools app
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

...though this will have to be a best guess, since there is no standard mail delivery failure mechanism in SMTP.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Satheeshkumar Subramaniam
Greenhorn

Joined: Jul 06, 2009
Posts: 21
Hi friends,
I came to know that DeliveryStatus class of com.sun.mail.dsn package(javamail 1.4) provide the option for tracking delivery notice status..
But how to use this class while receiving mails thorugh javamail API?
any suggessions?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42608
    
  65
I came to know that DeliveryStatus class of com.sun.mail.dsn package(javamail 1.4) provide the option for tracking delivery notice status.. But how to use this class while receiving mails thorugh javamail API?

See http://www.coderanch.com/t/434460/Other-JSE-JEE-APIs/java/get-delivery-status-notification#1931034

Please BeForthrightWhenCrossPostingToOtherSites; it's the polite thing to do.
Satheeshkumar Subramaniam
Greenhorn

Joined: Jul 06, 2009
Posts: 21

when I send mails, I want to check the status of the each mail.

can I get DSN (delivery status notification) for each mail I send.....
In javamail api com.sun.mail.dsn package provides 3 classes as
DeliveryStatus
MessageHeaders
MultipartReport

how to use these classes (I'm unable to get any info about these classes in tutorials)


thanks.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42608
    
  65
Why are you re-posting someone else's post here without attribution? I'm closing this thread, as it now duplicates the other one (where, in fact, you were pointed to a bunch of information).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to identify received mail is failure delivery notice mail in javamail?