This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Javamail and DSN

 
Thomas Calcagno
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,

I'm using Javamail to send e-mails to administrator of an application, with a copy to the interested user. These e-mails are sent with a technical address, so when the primary recipient turns to be invalid (it could occur), only the technical address receives the failed delivery notification.
I want the copy address(es) to receive this notification as well.

I found the DSN package of javamail:
http://javamail.kenai.com/nonav/javadocs/com/sun/mail/dsn/package-summary.html

But the way it works is quite nebulous for me, especially the DeliveryStatus class.
Does some of you guys already used this package? Or have a link to some example/tutorial. I failed to find something interesting...

Thanks,
Tom
 
Paul Clapham
Sheriff
Pie
Posts: 20158
23
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The description of the package in that documentation says:
Support for creating and parsing Delivery Status Notifications.

So, if you get a DSN then you can parse it using code from this package. Or if you're writing a mail server, you could use code from this package to create a DSN.

You'll notice it doesn't mention anything about requesting a DSN, which is what your question is about. So you're looking in the wrong place; except that the documentation does provide links to the RFCs which specify DSNs. One or both of them (I read them but don't remember which) describes how to change your e-mail message so that you're more likely to get a DSN.
 
Thomas Calcagno
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the clarifications Paul.

As you have some experience on this subject, do you know if it is possible to request multiple recipients for the DSN by working at the MIME level only? Or does it require to act at the MTA level?

I will have a better look at the RFCs tomorrow but it would be great if you could point me to the right direction
 
Paul Clapham
Sheriff
Pie
Posts: 20158
23
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unfortunately my experience consists of only a couple of hours perusing the RFCs and trying a few modifications to our existing e-mail-sending code. So I don't have an answer to that specific question. Sorry.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am fairly certain that you can only specify a single address to send a DSN to. If you search these forums for DSN posts made by me you will find pointers to helpful material.
 
Thomas Calcagno
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For what I read, you are right Ulf.

I looked for a way to change the recipient of the DSN - to set the copy address as the recipient instead of the "from" address - at the message level but it seems it is not possible, as DSN mechanisms are handled at MTA level.
Then I looked for an equivalent to the RRT header but found nothing.

I will look for another way, for instance sending the e-mail on behalf of the user which need to receive the failed delivery notification.

Regards,
Tom
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic