Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Multiple calls to (SMTP) transport.isConnected() on IIS causes 421. Known issue?

user11412595Sep 16 2014 — edited Oct 15 2014

Hello folks,


I thought I would share a recent finding that I spent some time nailing down, over the last few days.

If you're using JavaMail to connect to IIS SMTP and intermittently call transport.isConnected() to check if you're still connected, IIS will disconnect your connection with the following error:

"421 Too many errors on this connection---closing"

Is this a known issue with IIS? I  ran into this on IIS 7.5, but found a reference from long time ago mentioning version 5.0 as well. The microsoft support website does mention this rather nonchalantly here i.e.

NOOP CRLF

The SMTP-receiver should send a 250 reply to the NO OPERATION command. The only other possible responses are a 500 reply, indicating incorrect command syntax, or the 421 reply, indicating that the SMTP service will be shutting down shortly.


This seems to be contrary to RFC2821 regarding NOOP handling...

Is there a better way to check if the transport is still connected if one is sending lots of email in one connection? I am calling isConnected() twice during a send. I get disconnected after 8 emails are sent on a connection.

If this is a known issue on IIS, can it be added to the javamail wiki?


Thanks,


Hammad.

This post has been answered by user11412595 on Oct 15 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 12 2014
Added on Sep 16 2014
2 comments
1,689 views