agora inbox for pljava-dev@postgresql.org  
help / color / mirror / Atom feed
Subject: [Pljava-dev] emailing with pl/java
Date: Mon, 05 May 2008 11:01:33 -0700
Message-ID: <481F4B7D.20704@mcsnw.com> (raw)
In-Reply-To: <1A6E6D554222284AB25ABE3229A92762E9A2D4@nrtexcus702.int.asurion.com>
References: <1A6E6D554222284AB25ABE3229A92762E9A2B9@nrtexcus702.int.asurion.com>
	<1A6E6D554222284AB25ABE3229A92762E9A2D4@nrtexcus702.int.asurion.com>

Roberts, Jon wrote:
> CREATE OR REPLACE FUNCTION control.fn_smtp(p_smtp_server varchar, p_to
> varchar, p_from varchar, p_subject varchar, p_body varchar) returns
> varchar as
> 'smtp.send(java.lang.String, java.lang.String, java.lang.String,
> java.lang.String, java.lang.String)'
>   LANGUAGE 'java';
>
> It returns: "ERROR: IOException while sending message"
>
> What gives?  Why doesn't this work in pl/java but works just fine from
> the command line?
>   
I believe the security of the 'java' language is probably getting in 
your way. It doesn't allow you to open files, so it probably doesn't 
allow you to open socket connections, either. Try using the 'javau' 
language, which has no security checks:

e.g. CREATE OR REPLACE FUNCTION control.fn_smtp ... LANGUAGE 'javau';

Good luck,
Lucas




view thread (4+ messages)  latest in thread

Message-ID: <481F4B7D.20704@mcsnw.com>
Permalink:  ../481F4B7D.20704@mcsnw.com/
Also on:    postgresql.org/message-id/481F4B7D.20704@mcsnw.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pljava-dev@postgresql.org
  Subject: Re: [Pljava-dev] emailing with pl/java
  In-Reply-To: <481F4B7D.20704@mcsnw.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox