Problems using JavaMail-API within Tomcat

2008-08-12 Thread Gregor Schneider
Hi guys,

recently our server crashed (Debian), and since then I'm having
problems getting JavaMail to run within Tomcat 5.5

I've defined a ressource within $catalina_home/context.xml:

Resource name=mail/Session auth=Container
type=javax.mail.Session
mail.smtp.host=myserver.com/

The above named server is listed in my /etc/hosts

I can ping myserver.com

However, I get an exception saying

javax.servlet.ServletException: 501 Syntax: HELO hostname


org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.FormMailerDE_jsp._jspService(FormMailerDE_jsp.java:169)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


I've downloaded the source-code of the Javamail (1.4.1) and what I can
see is the following:

Tomcat just sends

HELO

Instead of

HELO myserver.com

I've got no clue what is missing here, so if you gyus got any hint's
I'd really appreciate that..

TIA

Gregor
-- 
what's puzzlin' you, is the nature of my game
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problems using JavaMail-API within Tomcat

2008-08-12 Thread Ben Stringer
On Tue, 2008-08-12 at 16:07 +0200, Gregor Schneider wrote:

 
 I've got no clue what is missing here, so if you gyus got any hint's
 I'd really appreciate that..

Hi Gregor,

I've often had problems with javamail in Tomcat due to more than one
version of the javamail jar being on the classpath. Perhaps check if
this is the case.

Cheers, Ben



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problems using JavaMail-API within Tomcat

2008-08-12 Thread Gregor Schneider
Hi Ben,

On Tue, Aug 12, 2008 at 4:19 PM, Ben Stringer [EMAIL PROTECTED] wrote:
 On Tue, 2008-08-12 at 16:07 +0200, Gregor Schneider wrote:

 I've often had problems with javamail in Tomcat due to more than one
 version of the javamail jar being on the classpath. Perhaps check if
 this is the case.

nope - there's only one mail.jar in the entire tomcat-folder
(including sub-dirs)

there's also no mail.jar within sun's jdk.

besides a missing entry in /etc/hosts, what other reasons might be
that the hostname in the HELO-command is missing?

Losing my last hair...

Gregor
-- 
what's puzzlin' you, is the nature of my game
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problems using JavaMail-API within Tomcat

2008-08-12 Thread Johnny Kewl


- Original Message - 
From: Gregor Schneider [EMAIL PROTECTED]

To: Tomcat Users List users@tomcat.apache.org
Sent: Tuesday, August 12, 2008 4:07 PM
Subject: Problems using JavaMail-API within Tomcat



Hi guys,

recently our server crashed (Debian), and since then I'm having
problems getting JavaMail to run within Tomcat 5.5

I've defined a ressource within $catalina_home/context.xml:

   Resource name=mail/Session auth=Container
   type=javax.mail.Session
   mail.smtp.host=myserver.com/

The above named server is listed in my /etc/hosts

I can ping myserver.com

However, I get an exception saying

javax.servlet.ServletException: 501 Syntax: HELO hostname

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
org.apache.jsp.FormMailerDE_jsp._jspService(FormMailerDE_jsp.java:169)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


Greg I've never had to do this on my systems... but I've noticed that if the 
DNS gives crap, or the machine has a problem finding its own host name, 
JavaMail goes beserk... apparently there is a property to set if a machine 
cant find itself...


mail.smtp.localhost
note not
mail.smtp.host
which is the normal smtp one...

So that will probably fix it, but maybe the real thing to do is find out why 
that machine doesnt know who it is ;)
Then also if you testing remember to put the host name in that the mail 
SP expects... otherwise the other thing that happens is they reject you as 
some foreign SPAM... ;)


its HELO (blank) because when java asks the machine who it is... it doesnt 
know ;)

... I think
---
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problems using JavaMail-API within Tomcat

2008-08-12 Thread Gregor Schneider
Hi jonny,

On Tue, Aug 12, 2008 at 5:06 PM, Johnny Kewl [EMAIL PROTECTED] wrote:

 its HELO (blank) because when java asks the machine who it is... it doesnt
 know ;)


that was the clue I was looking for

after the crash the hostname in /etc/hostname wasn't configured - duh

thanx!

gregor
-- 
what's puzzlin' you, is the nature of my game
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]