tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rainer Frey" <>
Subject Re: Tomcat 6 and javamail
Date Thu, 27 Nov 2008 13:29:55 GMT
On Thursday 27 November 2008 12:52:56 Lyallex wrote:

(It would be easier to answer if you'd stop top quoting - but I won't correct 
this whole mail)

> OK, firstly thanks for the feedback so far
> Let me be quite clear about one thing.
> I am using the same mail server in both cases. Tomcat and Eclipse are
> running on the same physical device with the same IP address.
> The mail server does not require authentication when accessed from the
> office subnet. The server guys have confirmed this.

So the problem is certainly on Java side.

> If I configure a JavaMail session as described in the following resource
> (JavaMail section)
> and set auth to false in context.xml everything works perfectly when
> sending mail from the web application.

It then should not be anything related to Javamail or Java version, 
incompatible jar files ...

> I am using the same mail server for the standalone test, the test
> where the mail component is configured to use the JNDI resource
> configured in context.xml and the test where the mail component uses
> the same configuration mechanism as the standlone test. The only test
> that fails is the last one.
> Something has changed since Tomcat 5.  I have exactly the same
> component running in several webapps on Tomcat 5 servers without any
> need to configure JNDI resources/Mail sessions etc

In such a setup, a javamail session is no managed resource for tomcat. I can't 
imagine how the tomcat version could have any influence on that. There must 
be any other difference between your eclipse runtime and this failing tomcat.  

> JAVA_OPTS and CATALINA_OPTS have not been modified by me and do not
> contain anything other that the default settings (none of which appear
> to have anything to do with mail config settings).

Is there any other webapp that might set system properties with mail related 
content? I'd make sure and use an empty Properties object for your test. the 
only reason to use System.getProperties() is the ability to pass JavaMail 
configuration to the JVM command line. I'm not sure what static variables and 
Singletons Javamail has, so I'd test without the resource configuration (even 
if you don't use it anyway) and the Javamail jars in WEB-INF/lib. If this is 
not successful, I guess it's impossible to help unless you post more code, 
complete exception messages and perhaps the output of Javamail with 
mail.debug=true. As I think it is not directly related to tomcat, I'd 
recommend asking on the Javamail list though, they might know more details.


> Any ideas much appreciated.
> lyallex
> 2008/11/26 Rainer Frey <>:
> > On Wednesday 26 November 2008 08:37:14 Rainer Frey wrote:
> >> > In the MailServer constructor I do the following
> >> >
> >> > properties = System.getProperties();
> >> > ...
> >> > properties.put("mail.smtp.auth", "false");
> >> >
> >> > so it looks like a different properties bundle is being used when I
> >> > run this in Tomcat ... does any of this make sense ??
> >
> > Argh, I overlooked that you use System.getProperties() here. If you
> > specify any JavaMail related Properties in JAVA_OPTS or CATALINA_OPTS
> > environment variables, this will be different indeed. You might want to
> > check your tomcat start script.
> >
> > Rainer
> >
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail:
> > To unsubscribe, e-mail:
> > For additional commands, e-mail:
> ---------------------------------------------------------------------
> To start a new topic, e-mail:
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message