> You're right.
> It used to handle them, but I remember when Peter Goldstein 
> changed the protocol handlers it stopped, IIRC because that 
> was argued to be non-compliant with something (I forget what, 
> rfc822 probably).
> I'd be suprised if it isn't trivial to "fix".
> 
> Perhaps only this...

Just checked and this does not work.

Here is my debug:
-------------------
mail from: <[EMAIL PROTECTED]>
rcpt to: <[EMAIL PROTECTED]>
DATA
Subject: test

.
mail from: <[EMAIL PROTECTED]>
rcpt to: <[EMAIL PROTECTED]>
DATA
Subject: test2

.
quit
-------------------
And here is how James handle this:

-----------
mail from: <[EMAIL PROTECTED]>
rcpt to: <[EMAIL PROTECTED]>
DATA
-----------
The rest of the commands gets buffered somewhere and will be interpreted
after a new "\r\n.\r\n" insereted later.

The problem is probably that CRLFTerminatedReader add a buffer on top of the
socket.inputStream() so when we create the reader for the DATA most of our
pipelining inputStream already get buffered from the CRLFTerminatedReader
internal buffer (BufferedReader).

I see 2 possible solutions:
1) use the mark() and reset() methods of the BufferedInputStream to mark the
socket input stream after each command and reset() it before wrapping it in
the doDATA method.
2) remove buffering from the CRLFTerminatedReader.

I've tried the second solution changing the CRLFTerminatedReader so to
extend InputStreamReader instead of BufferedReader but it still doesn't work
(same behaviour). I don't know why: no time to check it better.

Stefano

> Index: SMTPHandler.java
> ===================================================================
> --- SMTPHandler.java    (revision 170589)
> +++ SMTPHandler.java    (working copy)
> @@ -308,7 +308,7 @@
>              // that those in the DATA command are guaranteed
>              // to be ASCII
>              // inReader = new BufferedReader(new 
> InputStreamReader(in, "ASCII"), 512);
> -            inReader = new CRLFTerminatedReader(in, "ASCII");
> +            inReader = new BufferedReader(new 
> CRLFTerminatedReader(in,
> "ASCII"), 512);
>              remoteIP = socket.getInetAddress().getHostAddress();
>              remoteHost = socket.getInetAddress().getHostName();
>              smtpID = random.nextInt(1024) + "";



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to