Hi all,
I am finalizing the integration of Cancel-Lock into INN, based on the libcanlock library maintained by Michael (and Dennis Preiser before him).
As the news admin needs an easy way to cancel articles sent from his news server in case of abuse or for whatever reason, I have added a "gencancel" tool that generates the cancel control article to send. As a matter of fact, he needs computing the
right Cancel-Key header field to authenticate the cancel with his admin secret.
Here is what I have come up with right now:
Usage: gencancel [-adkm] [-b body] [-c charset] [-f from] [-n newsgroups]
[-s subject] '<Message-ID>'
-a Do not add an Approved header field
-b body Use the argument as the body of the cancel article
-c charset Use the argument for the Content-Type charset
-d Do not use local time for the Date header field
-f from Use the argument for the From and Approved header fields
-k Only write the body of the Cancel-Key header field
-m Do not generate a Message-ID for the cancel article
-n newsgroups Use the argument for the Newsgroups header field
-s subject Use the argument for the Subject header field
Message-ID The Message-ID to cancel (with quotes around for the
shell, and angle brackets)
% gencancel '<
[email protected]>'
gencancel: Cannot find article <
[email protected]> in history; you may want to use -n
The Newsgroups header field will be automatically set to the value of the original article (if still in your news spool).
Otherwise, "-n news.software.nntp" should be for instance given.
Basically, it will generate a proto-article like this:
% gencancel '<
[email protected]>' -f '
[email protected]' From:
[email protected]
Newsgroups: local.test
Subject: cmsg cancel <
[email protected]>
Control: cancel <
[email protected]>
Date: Sat, 19 Feb 2022 23:18:34 +0100 (CET)
Approved:
[email protected]
Message-ID: <surqbq$24bml$
[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Cancel-Key: sha1:w1saUe2FYUi48sVbVtKcm7cdznE= sha256:3Wb6ayHU0EdK7BQGIa6vma6RpPRgzo1lmxphpu5zaUo=
Admin cancel.
which can be piped into inews, and that's it. Cancel done!
I've kept the legacy "cmsg cancel <mid>" as default Subject but I can put "cancel <mid>" or any better idea as default.
% gencancel '<
[email protected]>' | inews -h -s
(-h to say the proto-article contains headers, -s to prevent the addition of a Sender header field)
Also, for people just wanting the hashes to use, the -k parameter outputs them:
% gencancel '<
[email protected]>' -k sha1:w1saUe2FYUi48sVbVtKcm7cdznE= sha256:3Wb6ayHU0EdK7BQGIa6vma6RpPRgzo1lmxphpu5zaUo=
This way, the news admin or an external program can easily make use of them (for a supersede request for instance).
If Cancel-Lock support is not enabled, gencancel also works for unauthenticated cancels (it will just not generate the Cancel-Key header field).
Naturally, if one wants to customize even more the output of gencancel, he can echo additional header fields, modify existing fields with sed or any commands he wants.
That's why I think this basic gencancel should normally fit most (if not all) needs.
But I prefer to ask here, in case I missed something important.
So, do you think this proposal is enough for the needs of news admins? Otherwise, what would you need?
Better provide the useful stuff in the initial release than having to ask and then wait for the next release!
--
Julien ÉLIE
« Nul n'entre ici s'il n'est géomètre. » (Platon)
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)