Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.



6757 posts

Uber Geek
+1 received by user: 443

Trusted
Subscriber

Topic # 106293 21-Jul-2012 08:43 Send private message

I'm writing a Spring/Java/Tomcat app, and I'm having a problem with getting it to send email. I can send email fine from a given piece of code when run as a standalone Java application, but when it runs within Tomcat it runs fine but Javamail doesn't work properly, throws an error at the start of the email conversation. I think I may have narrowed it down to multiple javamail implementations, but I'm not sure yet, but I'm still seeing something a bit bizzare.

The most bizarre part is the email server isn't behaving as I'd expect when I telnet to the server (try it youserlf) - the first EHLO or HELO is always sent a 500 unrecognised command reply, but exactly the same command repeated works.

220-gator84.hostgator.com ESMTP Exim 4.77 #2 Fri, 20 Jul 2012 15:18:52 -0500
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
EHLO testdomain.com
500 unrecognized command
EHLO testdomain.com
250-gator84.hostgator.com Hello testdomain.com [my IP removed]
250-SIZE 52428800
250-PIPELINING
250-AUTH PLAIN LOGIN
250-STARTTLS
250 HELP

And another session

220-gator84.hostgator.com ESMTP Exim 4.77 #2 Fri, 20 Jul 2012 15:20:10 -0500
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
HELO bob.com
500 unrecognized command
HELO bob.com
250 gator84.hostgator.com Hello bob.com [my IP removed]

Here's the logs from tomcat which show much the same thing

DEBUG: getProvider() returning provider protocol=smtp; type=javax.mail.Provider$Type@62e26a4a;.apache.geronimo.javamail.transport.smtp.SMTPTransport; vendor=Apache Software Foundation;version=1.0
SMTPTransport DEBUG: Connecting to server mail.headphonereviews.org:25 for user (removed)
SMTPTransport DEBUG: Attempting plain socket connection to server (removed):25
220-gator84.hostgator.com ESMTP Exim 4.77 #2 Fri, 20 Jul 2012 15:28:20 -0500
>>>>>Sending data EHLO (removed)<<<<<<
EHLO (removed)
220-We do not authorize the use of this system to transport unsolicited,
>>>>>Sending data HELO (removed)<<<<<<
HELO (removed)
220 and/or bulk e-mail.



The thing that throws me is telnetting to the SMTP port gives me the same failure as Javamail gets running inside tomcat, but running as an app it works fine.

I know a little about email, I wrote an email server about ten years ago, nothing commercial just a university project, but I'm not an email expert. Any thoughts or ideas?




Asus eee pad transformer
iPod 2G
Windows 7 PC
Lots and lots of Nikon camera gear

Create new topic

gzt

4434 posts

Uber Geek
+1 received by user: 214

Subscriber

  Reply # 659795 22-Jul-2012 09:31 Send private message

Any difference if you use the ip address of the mail server?



6757 posts

Uber Geek
+1 received by user: 443

Trusted
Subscriber

  Reply # 659796 22-Jul-2012 09:34 Send private message

Nope. I discovered that if you use telnet connection type this happens, if you use a raw connection type (in putty) the problem goes away.

I also tracked down the Java problem. EclipseLink depends on a library that depends on another JavaMail implementation, so I need to get JavaMail onto the Tomcat classpath before that. It's proving to be weird though, class loading inside tomcat's a pita.




Asus eee pad transformer
iPod 2G
Windows 7 PC
Lots and lots of Nikon camera gear

Create new topic




Twitter »
Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:




News »

Trending now »
Hot discussions in our forums right now:

Moment of Truth?
Created by BarTender, last reply by BarTender on 18-Sep-2014 09:41 (322 replies)
Pages... 20 21 22


10 Iphone 128gb 6+ iphones this weekend at auckland airport
Created by frysie, last reply by TimA on 17-Sep-2014 22:02 (36 replies)
Pages... 2 3


Mr. Key to extradite Kim Dotcom?
Created by TimA, last reply by SaltyNZ on 18-Sep-2014 09:20 (126 replies)
Pages... 7 8 9


Spark DNS Issues - Amazing - Broadband Service Alert
Created by PeteS, last reply by Demeter on 15-Sep-2014 14:13 (307 replies)
Pages... 19 20 21


hp bios update
Created by foxy38, last reply by foxy38 on 14-Sep-2014 19:08 (26 replies)
Pages... 2


Linksys EA6700 $98 at Harvey Horman
Created by macuser, last reply by macuser on 16-Sep-2014 15:18 (18 replies)
Pages... 2


Gigatown finalists and retail provider
Created by freitasm, last reply by macuser on 17-Sep-2014 23:02 (17 replies)
Pages... 2


2014 Holden SS (V8) or Ford XR6-T (in-line 6 turbo)
Created by joker97, last reply by ilovemusic on 16-Sep-2014 14:34 (71 replies)
Pages... 3 4 5



Geekzone Live »
Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.

Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.