You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Quinton Delpeche <qu...@vippayroll.co.za> on 2004/11/23 13:13:43 UTC

Tomcat 5 and Mail...

Hey Everybody,

I picked up a funny.

Code that was working perfectly on Tomcat 4 now doesn't run on Tomcat 5 
anymore, specifically the sending of the mail.

I have narrowed it down to this little piece of code:
<CODE>
	//Send the message.
	Transport.send(mesMailer);
</CODE>

I checked my Catalina.policy file and made sure that this entry was there:
<CATALINA_POLICY>
permission java.net.SocketPermission "mail.server.name:25", 
"connect,resolve" ;
</CATALINA_POLICY>

This didn't work, so I added the following options to the Catalina.policy file 
for each individual application running on the server:
<CATALINA_POLICY>
grant codeBase "file:${catalina.home}/webapps/ROOT/-" {
     permission java.net.SocketPermission "172.20.5.15:5432", "connect";
     permission java.net.SocketPermission "smtp.vippayroll.co.za:25, 
"connect";
};

grant codeBase "file:${catalina.home}/webapps/consulting/-" {
     permission java.net.SocketPermission "mail.server.name:25, 
"connect,resolve";
};

grant codeBase "file:${catalina.home}/webapps/debtors/-" {
     permission java.net.SocketPermission "mail.server.name:25, 
"connect,resolve";
};

grant codeBase "file:${catalina.home}/webapps/placements/-" {
     permission java.net.SocketPermission "mail.server.name:25, 
"connect,resolve";
};

grant codeBase "file:${catalina.home}/webapps/sales/-" {
      permission java.net.SocketPermission "mail.server.name:25, 
"connect,resolve";
};

grant codeBase "file:${catalina.home}/webapps/training/-" {
     permission java.net.SocketPermission "mail.server.name:25, 
"connect,resolve";
};
</CATALINA_POLICY>

Am I missing something?
Is there something that has majorly changed between Tomcat 4 and Tomcat 5?

Please help. :) 

Q
-- 
Quinton Delpeche
Internal Systems Developer
Softline VIP

Telephone: +27 12 420 7000
Direct:    +27 12 420 7007
Facsimile: +27 12 420 7344

http://www.vippayroll.co.za/

Power, n:
	The only narcotic regulated by the SEC instead of the FDA.