Re: Sending SMTP message gets stuck upon exception

Chris Burdess <[email protected]> Sat, 24 Jan 2004 13:42:00 +0100
Newsgroups gmane.comp.java.classpath.extensions.discuss
Message-ID <[email protected]>
Øyvind Harboe wrote:
> If an exception is thrown while an SMTP message body is being written,
> the subsequent "QUIT" command is ignored, because it is considered 
> part of the
> message body which then causes the app to wait indefinitely for the 
> QUIT command
> to complete.

How are you calling QUIT? If you're using the SMTPConnection directly, 
you can issue finishData(), rset(), quit() in that order. If you're 
using the JavaMail SMTP provider, you may be calling close() after the 
exception; since the exception typically signals an I/O error, the 
connection state is not normally recoverable.

By the way, the (incomplete) patch you supplied relates to inetlib - if 
you could address these to [email protected], it would be much 
appreciated.
-- 
Chris Burdess