Skip to Main Content

Java and JavaScript in the Database

Announcement

Testing banner

error while connect to mailserver with javamail package

Frank LehmannNov 29 2022

Hi,
i have a problem getting mail folder connect within the database using java stored procedure.
My own mailserver is in the same subnet like my database server is.
example:
IP of mailserver is 192.168.200.1
IP of server with database is 192.168.200.2
When i connect with package "plsql_mail_client.1.1.5" from database to mailserver, then it is working fine and i can get all mails in the mailbox.

But when the mailserver is outside my own subnet or ip range, then i am getting error :
ORA-29532: Java-Aufruf durch nicht abgefangene Java-Ausnahme beendet: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: imap.gmx.net, 993; timeout -1;
nested exception is:
java.net.SocketTimeoutException: Operation timed out
ORA-06512: in "SYS.MAIL_CLIENT", Zeile 16
ORA-06512: in "SYS.MAIL_CLIENT", Zeile 35
ORA-06512: in Zeile 24
29532. 00000 - "Java call terminated by uncaught Java exception: %s"
*Cause: A Java exception or error was signaled and could not be
resolved by the Java code.
*Action: Modify Java code, if this behavior is not intended.

And there is no firewall setting blocking server ip or port number.
The permission for is set "java.net.SocketPermission"
dbms_java.grant_permission( '<SCHEMA>','SYS:java.net.SocketPermission', '*', 'resolve,connect');

And testing same connection outside the database with a testcase it is working fine also.
Testing for example with telnet imap.gmx.net 993 is working fine also.

Any hints why the database is blocking connection to servers outside my ip range ?

Comments
Post Details
Added on Nov 29 2022
0 comments
6 views