james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noel J. Bergman" <n...@devtech.com>
Subject RE: Understanding the SMTPHandler Data method
Date Fri, 06 Jun 2003 01:19:50 GMT
> I have totally different objectives from JAMES.

What are your objectives?  :-)

> So I'm trying to understand how SMTPHandler: doData works.
> I've tried to do a little refactoring

FWIW, see a message I posted this morning for more information on how the
handlers may change in the future.

> how does the doDATA and its collaborating streams
> work?

The different streams add behavior to the pipe, as detailed below:

> in = new BufferedInputStream(socket.getInputStream(), 1024);

  This is the raw input stream.

> InputStream msgIn = new CharTerminatedInputStream(in,SMTPTerminator);

  The CharTerminatedInputStream is an InputStream that reads until
  it recognizes the particular pattern of data specified.  In this
  case, it is looking for CRLF.CRLF.

> msgIn = new SizeLimitedInputStream(msgIn,
>                smtpProtocol.getPropertyLong(MAX_MSG_SIZE));

  This imposes a limit on the amount of data that will be allowed
  through the stream.

> msgIn = new DotStuffingInputStream(msgIn);

  This decodes dot stuffing.

> Mail mail = Mail.create(msgIn);

This is a change to the Mailet API, not the James server implementation.  We
do not want to see the Mailet API balkanized.  Do what you want with the
org.apache.james.* packages in your fork.  In the above case, you could do:

  Mail mail = MailImpl.create(msgIn);

and no one would care.  If you do feel that it is necessary to change the
Mailet Specification, please bring up your proposals for discussion.

	--- Noel

To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org

View raw message