Article View: news.software.nntp
Article #92380Re: INN laxmid clarification
From: Julien ÉLIE
Date: Sun, 31 Aug 2025 08:16
Date: Sun, 31 Aug 2025 08:16
141 lines
6329 bytes
6329 bytes
Hi Jesse,
>>> Date: Wed, 31-Dec-69 18:59:59 EDT
>>
>> Wouldn't it be possible to somehow rewrite the Date header field before
>> injecting the article? (The old one could be kept in an X-Date header
>> field.) There may be news readers that are unable to parse them too.
>
> Will have to do something to bring these articles in. Since these exist on a
> server that speaks (limited) NNTP, I am trying to bring in as many as possible
> without having to download, modify, and inject.
Understood.
As your use is very specific, and writing a proper parsing of that kind
of dates is time-consuming and complicated (as Russ told us), I wonder
whether the faster approach wouldn't be to add a new level of control in
syntaxchecks:
syntaxchecks: [ laxmid laxdate ]
which would just take the current time (= arrival time) as the posting
date when the Date header field exists and is not parseable. The
information is recorded in the history file and overview for expiry
purpose, so it shouldn't break anything as far as I see.
INN already considers there's no expires date when the Expires header
field is not parseable, without rejecting the article.
makehistory already takes the time of the rebuild as the posting date
when the Date header field is not parseable.
NEWNEWS uses arrival times.
If it looks good to you, I can properly integrate that laxdate behaviour
in INN. Meanwhile, you could just use:
--- a/innd/art.c
+++ b/innd/art.c
@@ -1054,11 +1054,7 @@ ARTclean(ARTDATA *data, char *buff, bool ihave)
data->Posted = parsedate_rfc5322_lax(p);
if (data->Posted == (time_t) -1) {
- sprintf(buff, "%d Bad \"Date\" header field -- \"%s\"",
- ihave ? NNTP_FAIL_IHAVE_REJECT : NNTP_FAIL_TAKETHIS_REJECT,
- MaxLength(p, p));
- TMRstop(TMR_ARTCLEAN);
- return false;
+ data->Posted = data->Arrived;
}
if (HDR_FOUND(HDR__INJECTION_DATE)) {
@@ -1066,11 +1062,7 @@ ARTclean(ARTDATA *data, char *buff, bool ihave)
data->Posted = parsedate_rfc5322_lax(p);
if (data->Posted == (time_t) -1) {
- sprintf(buff, "%d Bad \"Injection-Date\" header field --
\"%s\"",
- ihave ? NNTP_FAIL_IHAVE_REJECT :
NNTP_FAIL_TAKETHIS_REJECT,
- MaxLength(p, p));
- TMRstop(TMR_ARTCLEAN);
- return false;
+ data->Posted = data->Arrived;
}
}
--- a/storage/expire.c
+++ b/storage/expire.c
@@ -707,8 +707,7 @@ OVgroupbasedexpire(TOKEN token, const char *group,
const char *data,
}
when = parsedate_rfc5322_lax(p);
if (when == (time_t) -1) {
- EXPoverindexdrop++;
- return true;
+ when = arrived;
}
} else {
when = arrived;
>>> I did find a few more Message-ID variations that are rejected:
>>>
>>> <[OFFICE-3]GVT-RICH-490UQ> - 435 Syntax error in message-ID
>>> <366@mimir..dmt.oz> - 435 Syntax error in message-ID
>>> <[MC.LCS.MIT.EDU].851959.860315.KFL> - 435 Syntax error in message-ID
>>
>> These are indeed invalid domain names. I am under the impression that
>> the laxsyntax check should just ensure there are 1 to 248 (authorized)
>> chars surrounded by brackets, without verifying the number, order and
>> place of '.', '[', ']', etc.
>
> In my humble opinion, that's all it should need to do. This seems inline with
> how Cyclone and Diablo seem to behave by default (at least how I see
> commercial operators have them configured).
Here is a new proposal of patch (do not keep the 4 lines from the
previous patch which was specifically looking for '@'):
--- a/lib/messageid.c
+++ b/lib/messageid.c
@@ -155,6 +155,21 @@ IsValidMessageID(const char *MessageID, bool
stripspaces, bool laxsyntax)
/* Scan local-part: "< dot-atom-text". */
if (*p++ != '<')
return false;
+
+ if (laxsyntax) {
+ for (;; p++) {
+ if (!midnormchar(*p) && *p != '[' && *p != ']')
+ break;
+ }
+ if (*p++ != '>')
+ return false;
+ if (stripspaces) {
+ for (; ISWHITE(*p); p++)
+ ;
+ }
+ return (*p == '\0');
+ }
+
for (;; p++) {
if (midatomchar(*p)) {
while (midatomchar(*++p))
I'll naturally integrate it properly in a separate function so that this
check is not called by nnrprd. I'm waiting for your feedback for these
two changes in Message-ID and Date handling.
--
Julien ÉLIE
« Sur vingt personnes qui parlent de nous, dix-neuf en disent du mal et
la vingtième, qui en dit du bien, le dit mal. » (Rivarol)
Technical Details
Message-ID:
<10910cj$12r8f$1@news.trigofacile.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.pugleaf.net!ygg-srl.newsdeef.eu!srl.newsdeef.eu!weretis.net!feeder8.news.weretis.net!news.trigofacile.com!.POSTED.2001:861:3f81:7990:8199:20e1:ddc1:9322!not-for-mailReferences:
<u90srm$2mhb$1@nnrp.usenet.blueworldhosting.com> <87ms7g7jvb.fsf@hope.eyrie.org> <108vhqb$1nrv$1@nnrp.usenet.blueworldhosting.com> <108vuvv$11j2t$1@news.trigofacile.com> <10906hu$2tvn$1@nnrp.usenet.blueworldhosting.com>Show Full Headers
Complete Article Headers
Message-ID: <10910cj$12r8f$1@news.trigofacile.com> Subject: Re: INN laxmid clarification Date: Sun, 31 Aug 2025 10:16:19 +0200 From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> References: <u90srm$2mhb$1@nnrp.usenet.blueworldhosting.com> <87ms7g7jvb.fsf@hope.eyrie.org> <108vhqb$1nrv$1@nnrp.usenet.blueworldhosting.com> <108vuvv$11j2t$1@news.trigofacile.com> <10906hu$2tvn$1@nnrp.usenet.blueworldhosting.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.pugleaf.net!ygg-srl.newsdeef.eu!srl.newsdeef.eu!weretis.net!feeder8.news.weretis.net!news.trigofacile.com!.POSTED.2001:861:3f81:7990:8199:20e1:ddc1:9322!not-for-mail Newsgroups: news.software.nntp Organization: Groupes francophones par TrigoFACILE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sun, 31 Aug 2025 08:16:19 -0000 (UTC) Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="2001:861:3f81:7990:8199:20e1:ddc1:9322"; logging-data="1142031"; mail-complaints-to="abuse@trigofacile.com" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:+ZBZDYZUrfKezG7RyR5CYe1CO/Y= sha256:bZO0lkZSzq4ngBqj8asoHnd1EjD5qX6jxkOwnZLEZm8= sha1:PwBB5SBNSgrIhqnwRKGP8q3r7Jg= sha256:afz2BD58HTpROqVNIrSygpzSCJDkULKtYpceJ214FA8= In-Reply-To: <10906hu$2tvn$1@nnrp.usenet.blueworldhosting.com>