[...]
Is there an exhaustive list of headers that should only appear once that
I could test when receiving an article in a server to server exchange?
[...]
When RELAYING an article, I am currently only testing the unicity of a
few headers that are useful for the relay but I would like to do better.
Is there an exhaustive list of headers that should only appear once that
I could test when receiving an article in a server to server exchange?
It is to some degree up to you. Relaying agents are allowed to be strict about RFC 5536 compliance, or they're allowed to relay messages that don't follow the standard but can still be processed.
Control
Date
Distribution
Injection-Date
Message-ID
Newsgroups
Path
Supersedes
Archive
Content-Transfer-Encoding
Content-Type
Expires
Followup-To
Injection-Info
MIME-Version
References
Approved
Lines
Organization
Summary
User-Agent
Xref
but duplication is unlikely to cause major practical problems (although
some servers may honor Lines instead of count lines for themselves and get confused, and duplicated Xref headers would cause serious problems when copying article numbers from another server).
I may be forgetting some of the MIME headers since I didn't refresh my
memory from the relevant RFCs.
In some cases it's arguable that the article is still sensible if the
header is duplicated but both copies of the header have the same value
(the most common duplication error in my experience), but it's still technically invalid to duplicate them.
The list in innd/innd.c controls what headers are exposed to posting
filters, so is sort of absurdly long and includes all kinds of things that probably aren't directly relevant.
What about :
- From
- Subject
- Archived-At
- Bcc
- Cc
- Keywords
- Reply-To
- Sender
- To
- Nntp-Posting-Date
- Nntp-Posting-Host
- X-Complaints-To
- X-Trace
- Also-Control
- Article-Name
- Article-Updates
- Date-Received
- Posting-Version
- Relay-Version
- See-Also
- Cancel-Key
- Cancel-Lock
In some cases it's arguable that the article is still sensible if the
header is duplicated but both copies of the header have the same value
(the most common duplication error in my experience), but it's still
technically invalid to duplicate them.
Added to my to-list :-)
I do not manage filters with calls to perl or python but they can be set
for injection and/or relay (Some sort of postfilter and cleanfeed) and I
will use this (long) list to initialize a combo in the GUI part of the software.
Added to my to-list :-)
Note that for relaying you can't fix this (by dropping one of the
duplicates) since that's an unpermitted alteration of the article. You
have to either accept it or reject it.
On injection, it may not be a bad idea to toss duplicate header fields
that have the same content before rejecting articles that still have duplicates. It's just a bit friendlier to broken posting agents; whether
you want to be friendly to such things is a bit of a judgment call.
I do not manage filters with calls to perl or python but they can be set
for injection and/or relay (Some sort of postfilter and cleanfeed) and I
will use this (long) list to initialize a combo in the GUI part of the
software.
I'm not sure I would. I don't think having a long list of headers that
you care about was the right design for INN's filters. It's just hard to
fix now.
I'd be more inclined to populate a dropdown with protocol headers that
people are likely to care about and then let people type in the names of additional headers if they care.
Incidentally, I see that I once wrote at the end of the header table:When INJECTING an article, some headers should not appear and
others should appear only once. I do the checks in a way similar
to INN (nnrp/post.c)
- Article-Name
I do not manage filters with calls to perl or python but they can be set
for injection and/or relay (Some sort of postfilter and cleanfeed) and I
will use this (long) list to initialize a combo in the GUI part of the
software.
I'm not sure I would. I don't think having a long list of headers that
you care about was the right design for INN's filters. It's just hard to
fix now.
/* The Comments and Original-Sender header fields can appear more than once
* in the headers of an article. Consequently, we MUST NOT put them here.
*/
So all the header fields listed there are supposed to appear only once
(and is tested by StripOffHeaders()).
- Article-Name
It is "Article-Names" (with an "s"). I mention it in case you
implemented it without the "s".
https://github.com/InterNetNews/inn/issues/73
"Provide the entire article headers to innd filters, probably in a
special key in the hash similar to the BODY key."
This would have saved the need to manually add useful header fields.
At least, there aren't new ones every year to add! Hopefully it has
been a long time since the last addition (following a user request).
Amongst other header fields not mentioned in this thread, I would check
that X-PGP-Key and X-PGP-Sig are unique.
/* The Comments and Original-Sender header fields can appear more
than once
* in the headers of an article. Consequently, we MUST NOT put them
here.
*/
So all the header fields listed there are supposed to appear only once
(and is tested by StripOffHeaders()).
Since this table is part of the "nnrp.c" code, I assume that it is only
used for injection (POST) not for transit (IHAVE)? No?
I just want to offer the possibility (configurable) of rejecting
articles received from a feed with duplicate headers that don't really
make sense. Otherwise only primordial headers will be tested to be unique.
Amongst other header fields not mentioned in this thread, I would
check that X-PGP-Key and X-PGP-Sig are unique.
Thanks to mention them, will be added to be unique for transit.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 66:25:53 |
Calls: | 6,712 |
Files: | 12,244 |
Messages: | 5,356,311 |