I'm trying to implement nntp server. But looks like I have a problem with multi line response. When I sent response client close connection. I'm using Thunderbird and SeaMonkey as clients.
I heed help to understand what wrong with my response. Thanks.
[S] server
[C] client
[S] 200NNTP Service Ready,posting permitted.
[C] MODE READER
[S] 200 Posting allowed
[C] GROUP group1
[S] 221 1 10100 10100
[C] XOVER 10100-10100
[S] 224
[S] 10100
[S] Subject 2104406756
[S] User0 <[email protected]>
[S] Tue Jan 28 11:32:44FET 2014
[S] <[email protected]>
[S] .
[C] HEAD 10100
[S] 221 10100 <[email protected]>
[S] Path: news.foo.bar!not-for-mail
[S] From: User0<[email protected]>
[S] Newsgroups: group1
[S] Subject: Subject 2104406756
[S] Date: Tue Jan 28 11:32:44FET 2014
[S] Message-ID: <[email protected]>
[S] .
upd1:
I installed plugin in Thunderbird for debugging traffic on client side (TBTracer) and looks like client can't understand my multi line response. Client received only first part of response. For example response for XOVER is multi line.
[NNTP] [13:54:29] 200 NNTP Service Ready, posting permitted.
[NNTP] [13:54:29] MODE READER
[NNTP] [13:54:30] 200 Posting allowed
[NNTP] [13:54:30] GROUP group1
[NNTP] [13:54:31] 221 1 10100 10100
[NNTP] [13:54:31] XOVER 10100-10100
[NNTP] [13:55:15] 224
[NNTP] [13:55:15] QUIT
According to RFC 3977:
3.1.1. Multi-line Data Blocks
- The block consists of a sequence of zero or more "lines", each being a stream of octets ending with a CRLF pair. Apart from those line endings, the stream MUST NOT include the octets NUL, LF, or CR.
I tried sent different type of lines but without any success. For example:
String r = "224\r\n10100\r\n6 Oct 2000 04:38:40\r\n<[email protected]>\r\n.\r\n";
The answer is simple. RFC 2980:
Example:
111\tSubject\tUser\tDate\t111\t\t