How NNTP messages are rewritten

The NNTP dæmon transforms the posted messages that it receives from News User Agents to a canonical form. It also places requirements on messages that it receives from peer NetNews nodes, which it expects to already be in canonical form.

Canonicalization

The transformation of a message to canonical form involves two things: a default client domain name and a default server domain name. NNTPD obtains both, for any given NNTP/TCP session, by constructing "domain literals" of the IP addresses of the server and client ends of the TCP connection.

Canonicalization applies to messages submitted in reader mode, via the post verb. It transforms the following headers in the message:

Content-Length:, NNTP-Posting-Host:, NNTP-Posting-Date:, Path:, and XRef:
These headers are discarded.
Date:
This header is added if not present.
Subject:
This header is added (with no content) if not present.
Message-ID:
This header is added if not present, using the default server domain name, the current time, and the ID of the NNTPD server process. Message IDs in existing headers may omit their domain name portions, in which event canonicalization will append the default client domain name to the ID. Message IDs will also have any SMTP comments stripped from them, and their bracketing "<" and ">" added if they are missing. Superfluous whitespace is also stripped, and the header re-folded.
Newsgroups:
The list of newsgroups is canonicalized by stripping SMTP comments and superfluous whitespace, and re-folding the header.
Sender: and From:
These headers are subjected to the same standard mailbox name canonicalizations as for SMTP messages, but using the default client domain name as both default domain name and default host name.

NNTPD rejects messages for reasons determined from header contents. These are not part of the message canonicalization process per se, however, and structly speaking apply to posted messages in their final, canonical, forms.

Canonical form

NNTPD requires messages submitted in "peer" mode, via the ihave verb, to already be in canonical form. Such canonical form requires the presence of syntactically correct Message-ID:, Newsgroups:, and From:headers; and the presence of Date: and Path: headers.


The Internet Utilities are © Copyright Jonathan de Boyne Pollard. "Moral" rights are asserted.