Sunday, March 3, 2013

A Pesky Domino JavaMail Error

Predicament: you’re trying to use JavaMail on a Domino server, and you’re getting this error:

javax.mail.NoSuchProviderException: No provider for Address type: rfc822

Explanation: JavaMail can’t see its configuration files. They’re there – the default JavaMail configuration files are baked into the JavaMail jars. But the Domino jvm’s Security Manager won’t let JavaMail read its own jars as data.

Solution: You need to modify the java.policy file on your Domino server. If your Domino server installation is in D:\Lotus\Domino, then java.policy is in the D:\Lotus\Domino\jvm\lib\security directory. java.policy is a text file, so you can use any text editor to make the changes.

Insert these lines just before the last line of java.policy, then restart the Domino server. (Note that the FilePermission lines will need editing to fit your Domino installation path, and that Java uses forward slashes in the pathname even on Windows.)
// Per http://www.oracle.com/technetwork/java/faq-135477.html#securityManager
// following two permissions allow access to default config files
permission java.io.FilePermission ”D:/Lotus/Domino/jvm/lib/ext/activation.jar”, “read”;
permission java.io.FilePermission ”D:/Lotus/Domino/jvm/lib/ext/mail.jar”, “read”;
// following to use SMTP
permission java.net.SocketPermission    ”SMTPHOST:25″, “connect,resolve”;
// following to use IMAP
permission java.net.SocketPermission    ”IMAPHOST:143″, “connect,resolve”;
// following to use POP3
permission java.net.SocketPermission    ”POP3HOST:110″, “connect,resolve”;
// following needed if System.getProperties() is used
//permission java.util.PropertyPermission “*”, “read,write”;
(Reposting this on the new blog because it’s genuinely useful.)

1 comment:


  1. I had a similar problem with java when only started to use the cloud server virtual dataroom, thank you for the solution of the problem!

    ReplyDelete