• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java Mail API and Applet Security

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to use the JAVAMAIL API through an applet on an INTRANET, not internet. I have read through over 100 posts on JavaRanch and Web Sites including java.sun.com regarding trusted applets and applet security.
The javamail API requires writing and reading the System.getProperties() but I can't seem to get my applet trusted enough to do so. I keep getting a securityexception on read, write. I know why, but I don't know how to fix it. Everything on JavaRanch seems to be a special case situation that only works for one person. Everything on java.sun.com is so "technical" and vague that questions are never answered.
What I am wanting to know are the exact steps I need to take to allow the Applet access to the System Properties. And I need to do so without manually creating a Policy File on each Client machine because I will never know what client machine is accessing my Applet.
Thanks for any help.
 
Yoo-Jin Lee
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gregg,
You should sign your applet to access the System resources. Check out:
http://developer.java.sun.com/developer/technicalArticles/Security/Signed/
cheers,
Yoo-Jin
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the response, but I found out a way to do it without signing the applet at all.
 
Yoo-Jin Lee
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So how did you do it then without changing signing the applet? Is the applet local?
cheers,
Yoo-Jin.
[ February 01, 2002: Message edited by: Yoo-Jin Lee ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The applet is not local. It does reside on an INTRANET. What I found out was that although the java.sun tutorial on the JAVAMAIL API shows that you do this line

There is really no need since the JAVAMAIL API doesn't use System Properties, at least not for just sending mail. So I changed it and just created a new Properties Object:

And that works for me. I did however have to put a mail server on the Server my applet resides on. I used PostCast Server. It is free and just acts as a go between for my companies Exchange Server. Works really well.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic