Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
    Bookmark Topic Watch Topic
  • New Topic

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

 
Satheeshkumar Subramaniam
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Report post to moderator


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
Posts: 1183
  • Mark post as helpful
  • send pies
  • Report post to moderator
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 ?
 
Satheeshkumar Subramaniam
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 1183
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
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.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
...though this will have to be a best guess, since there is no standard mail delivery failure mechanism in SMTP.
 
Satheeshkumar Subramaniam
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 21
  • Mark post as helpful
  • send pies
  • Report post to moderator

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
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
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).
 
    Bookmark Topic Watch Topic
  • New Topic