• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

Java Mail API and Applet Security

 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic