Purpose: Make the server tell the client a recommended Message-ID before POST. Reasoning: Many clients need to know the Message-IDs of their own postings for bookkeeping or other purposes, so they generate them themselves. But the better place for devising Message-IDs is the server to guarantee unambiguity. This is a simple NNTP protocol extension: in the 340 response to POST, the server gives a recommended Message-ID. It can be recognized by the <...@...> syntax. To utilize this feature, we need better clients, of course. Patch against: snapshot 19981013 --- nnrpd/commands.c.orig Wed Jul 22 07:12:30 1998 +++ nnrpd/commands.c Sat Oct 24 20:05:40 1998 @@ -660,12 +660,15 @@ size = 4096; article = NEW(char, size); } + idbuff[0] = 0; + if ((p = GenerateMessageID()) != NULL) + strcpy(idbuff, p); + Reply("%d Ok, recommended ID %s\r\n", NNTP_START_POST_VAL, idbuff); + (void)fflush(stdout); + p = article; end = &article[size]; - Reply("%d Ok\r\n", NNTP_START_POST_VAL); - (void)fflush(stdout); - for (l = 0, longline = 0; ; l++) { /* Need more room? */ if (end - p < ART_LINE_MALLOC) { @@ -731,7 +734,7 @@ response = ARTpost(article, idbuff); if (response == NULL) { syslog(L_NOTICE, "%s post ok %s", ClientHost, idbuff); - Reply("%s\r\n", NNTP_POSTEDOK); + Reply("%s %s\r\n", NNTP_POSTEDOK, idbuff); POSTreceived++; } else { --- nnrpd/post.c.orig Thu Aug 20 07:12:47 1998 +++ nnrpd/post.c Sat Oct 24 19:38:49 1998 @@ -323,8 +323,9 @@ ** Return NULL if okay, or an error message. */ STATIC STRING -ProcessHeaders(linecount) +ProcessHeaders(linecount, idbuff) int linecount; + char *idbuff; { static char MONTHS[] = "JanFebMarAprMayJunJulAugSepOctNovDec"; static char datebuff[40]; @@ -414,12 +415,7 @@ /* Set Message-ID */ if (HDR(_messageid) == NULL) { - if ((p = GenerateMessageID()) == NULL) { - (void)sprintf(Error, "Can't generate Message-ID, %s", - strerror(errno)); - return Error; - } - HDR(_messageid) = p; + HDR(_messageid) = idbuff; } /* Set Path */ @@ -911,7 +907,7 @@ if ((error = CheckIncludedText(article, i)) != NULL) return error; } - if ((error = ProcessHeaders(i)) != NULL) + if ((error = ProcessHeaders(i, idbuff)) != NULL) return error; if (i == 0 && HDR(_control) == NULL) return "Article is empty";