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.