You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Lawence <al...@yahoo.com> on 2003/10/03 21:56:15 UTC

Send mail cgi script doesn't work under tomcat?

Dear all,
 
I know not too many did this before. I enabled cgi support of Tomcat instead of integrating it to apache. Everything worked fine for the old cgi scripts except one fatal thing: the email script failed.  Seemed to me Tomcat has some security restriction on openning socket to communicate with a smtp server. Hence all the sendmail perl modules I tried failed at the very first step, trying to connect to the smtp server. I tried those modules as perl scripts instead of cgis under tomcat on the same machie, they all worked perfectly. Anyone knows how to get around this in tomcat? 
 
Thanks in advance!
 
 


---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search

RE: Send mail cgi script doesn't work under tomcat?

Posted by Patrick <pa...@aptitudexchange.com>.
In my case option 1 is the easiest. I already tried some things here and I
don't run into the same problem.

-----Original Message-----
From: Lawence [mailto:allforlinux@yahoo.com]
Sent: Monday, October 06, 2003 9:15 AM
To: Tomcat Users List
Subject: RE: Send mail cgi script doesn't work under tomcat?


Patrik,

So I am not alone.

Here are the possible soultions I came up with, hopefully they help.

1. If just a few cgi scripts and they are simple, port them to Java.
2. Integrate Tomcat with Apache, then you don't need to modify the cgi
scripts. However, the server configuration becomes more complicated.
3. Hack the useCGI servlet, I am not sure this works.
4. Just port the email portion to java and write it as a filter servlet,
which postprocess the requests after your CGI. (This is the one I would like
to try but did not try yet).



Patrick Willart <pa...@aptitudexchange.com> wrote:
Laurence,

I have the same problem and could not figure it out. It seems that the CGI
program isn't allowed to open a new socket.

You could try to enable the Security Manager and set it up so it allows for
opening sockets. However, I don't believe CGI scripts/programs are affected
by the Security Manager. Also my CGI program isn't allowed to open a new
socket with the Security Manager disabled, so I don't think it will help.

I posted the problem on this list yesterday but didn't get back any
response. If you figure out a way to get it working please let me know. I
wasted a couple of days on it and am currently working on porting the CGI
app to Java.

grts,

Patrick

-----Original Message-----
From: Lawence [mailto:allforlinux@yahoo.com]
Sent: Friday, October 03, 2003 12:56 PM
To: tomcat-user@jakarta.apache.org
Subject: Send mail cgi script doesn't work under tomcat?


Dear all,

I know not too many did this before. I enabled cgi support of Tomcat instead
of integrating it to apache. Everything worked fine for the old cgi scripts
except one fatal thing: the email script failed. Seemed to me Tomcat has
some security restriction on openning socket to communicate with a smtp
server. Hence all the sendmail perl modules I tried failed at the very first
step, trying to connect to the smtp server. I tried those modules as perl
scripts instead of cgis under tomcat on the same machie, they all worked
perfectly. Anyone knows how to get around this in tomcat?

Thanks in advance!




---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: Send mail cgi script doesn't work under tomcat?

Posted by Lawence <al...@yahoo.com>.
Patrik,
 
So I am not alone.
 
Here are the possible soultions I came up with, hopefully they help.
 
1. If just a few cgi scripts and they are simple, port them to Java.
2. Integrate Tomcat with Apache, then you don't need to modify the cgi scripts. However, the server configuration becomes more complicated.
3. Hack the useCGI servlet, I am not sure this works.
4. Just port the email portion to java and write it as a filter servlet, which postprocess the requests after your CGI. (This is the one I would like to try but did not try yet).
 
 

Patrick Willart <pa...@aptitudexchange.com> wrote:
Laurence,

I have the same problem and could not figure it out. It seems that the CGI
program isn't allowed to open a new socket.

You could try to enable the Security Manager and set it up so it allows for
opening sockets. However, I don't believe CGI scripts/programs are affected
by the Security Manager. Also my CGI program isn't allowed to open a new
socket with the Security Manager disabled, so I don't think it will help.

I posted the problem on this list yesterday but didn't get back any
response. If you figure out a way to get it working please let me know. I
wasted a couple of days on it and am currently working on porting the CGI
app to Java.

grts,

Patrick

-----Original Message-----
From: Lawence [mailto:allforlinux@yahoo.com]
Sent: Friday, October 03, 2003 12:56 PM
To: tomcat-user@jakarta.apache.org
Subject: Send mail cgi script doesn't work under tomcat?


Dear all,

I know not too many did this before. I enabled cgi support of Tomcat instead
of integrating it to apache. Everything worked fine for the old cgi scripts
except one fatal thing: the email script failed. Seemed to me Tomcat has
some security restriction on openning socket to communicate with a smtp
server. Hence all the sendmail perl modules I tried failed at the very first
step, trying to connect to the smtp server. I tried those modules as perl
scripts instead of cgis under tomcat on the same machie, they all worked
perfectly. Anyone knows how to get around this in tomcat?

Thanks in advance!




---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search

RE: Send mail cgi script doesn't work under tomcat?

Posted by Patrick Willart <pa...@aptitudexchange.com>.
Laurence,

I have the same problem and could not figure it out. It seems that the CGI
program isn't allowed to open a new socket.

You could try to enable the Security Manager and set it up so it allows for
opening sockets. However, I don't believe CGI scripts/programs are affected
by the Security Manager. Also my CGI program isn't allowed to open a new
socket with the Security Manager disabled, so I don't think it will help.

I posted the problem on this list yesterday but didn't get back any
response. If you figure out a way to get it working please let me know. I
wasted a couple of days on it and am currently working on porting the CGI
app to Java.

grts,

Patrick

-----Original Message-----
From: Lawence [mailto:allforlinux@yahoo.com]
Sent: Friday, October 03, 2003 12:56 PM
To: tomcat-user@jakarta.apache.org
Subject: Send mail cgi script doesn't work under tomcat?


Dear all,

I know not too many did this before. I enabled cgi support of Tomcat instead
of integrating it to apache. Everything worked fine for the old cgi scripts
except one fatal thing: the email script failed.  Seemed to me Tomcat has
some security restriction on openning socket to communicate with a smtp
server. Hence all the sendmail perl modules I tried failed at the very first
step, trying to connect to the smtp server. I tried those modules as perl
scripts instead of cgis under tomcat on the same machie, they all worked
perfectly. Anyone knows how to get around this in tomcat?

Thanks in advance!




---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org