I think dot stuffing in news server is ok.
Here is the relevant code from package
org.apache.james.nntpserver.repository. As far as I know it is right.

--------------------------------------------
// this interface is used to read the data from client and stream it
// into server repository
public interface NNTPLineReader {
    // reads a line of data.
    // @return null indicates end of data
    String readLine();
}

public class NNTPLineReaderImpl implements NNTPLineReader {
    private final BufferedReader reader;
    public NNTPLineReaderImpl(BufferedReader reader) {
        this.reader = reader;
    }
    public String readLine() {
        try {
            String line = reader.readLine();
            // check for end of article.
            if ( line.equals(".") )
                line = null;
            else if ( line.startsWith(".") )
                 line = line.substring(1,line.length());
            return line;
        } catch(IOException ioe) {
            throw new NNTPException("could not create article",ioe);
        }
    }
}
------------------------------------------------

Please tell me if you spot a mistake.
BTW. this is a different approach from SMTP DotStuffing code, not sure if
one makes sense over the other.

Harmeet


----- Original Message -----
From: "Danny Angus" <[EMAIL PROTECTED]>
To: "James-User@Jakarta. Apache. Org" <[EMAIL PROTECTED]>;
"James-Dev@Jakarta. Apache. Org" <[EMAIL PROTECTED]>
Sent: Tuesday, September 18, 2001 8:15 AM
Subject: Fw: I think I just spotted a bug in the news server


> I spotted this, I dunno if its a james bug or an RFC bug ;)
> post this message (if it gets through intact!) it gets truncated below
> "single dot below", and two dots at the beginning of the line are reduced
to
> one..
>
> "danny" <[EMAIL PROTECTED]> wrote in message news:...
> start
> two dots .. space word
> two dots ..word
> two dots on their own line below
> ..
> single dot below
> .
> blank line, single dot
>
> .
>
> blank line two dots
>
> ..
>
> I guess If I can see this I was wrong ;)
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


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

Reply via email to