You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Noel J. Bergman" <no...@devtech.com> on 2002/08/31 03:30:08 UTC

Incorrect Exception Handling: Maximum Message Size

Attached below is the log snippet.  The problem is shown here:

Exception opening socket: Unable to retrieve the data: Message size exceeds
fixed maximum message size.

"Message size exceeds fixed maximum message size." is from
MessageSizeException.

"Unable to retrieve the data" is from MimeMessageInputStreamSource, which
catches the MessageSizeException as an IOException, and throws it as a
RuntimeException.

"Exception opening socket" is from handleConnection, which is NOT where we
were supposed to handle the exception.  It was SUPPOSED to be handled in
doDATA, but doDATA is expecting it to be wrapped as a MessagingException,
not a RuntimeException.

Is there a reason why the MimeMessageInputStreamSource constructor doesn't
declare that it throws a MessagingException, and wrap it?

I need to fix this, but there are a couple of options, and I'm wondering why
the explicit declaration wasn't used.  Oversight or intent?

	--- Noel

DEBUG smtpserver: Sent: 354 Ok Send data ending with <CRLF>.<CRLF>
DEBUG smtpserver: Using SizeLimitedInputStream  with max message size:
4194304
DEBUG smtpserver: Exception opening socket: Unable to retrieve the data:
Message size exceeds fixed maximum message size.
java.lang.RuntimeException: Unable to retrieve the data: Message size
exceeds fixed maximum message size.
        at
org.apache.james.core.MimeMessageInputStreamSource.<init>(MimeMessageInputSt
reamSource.java:63)
        at org.apache.james.core.MailImpl.<init>(MailImpl.java:118)
        at
org.apache.james.smtpserver.SMTPHandler.doDATA(SMTPHandler.java:981)
        at
org.apache.james.smtpserver.SMTPHandler.parseCommand(SMTPHandler.java:349)
        at
org.apache.james.smtpserver.SMTPHandler.handleConnection(SMTPHandler.java:21
8)
        at
org.apache.avalon.cornerstone.blocks.connection.ConnectionRunner.run(Connect
ion.java:169)
        at
org.apache.avalon.excalibur.thread.impl.ExecutableRunnable.execute(Executabl
eRunnable.java:47)
        at
org.apache.avalon.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:8
0)


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>