Article View: news.software.nntp
Article #91013Re: inn: both Perl and Python filtering at the same time
From: Julien ÉLIE
Date: Tue, 24 Oct 2023 15:18
Date: Tue, 24 Oct 2023 15:18
35 lines
2476 bytes
2476 bytes
Hi Adam, > One more thing. Is it possible to redirect an article using a Python > filter? I'd want to edit some headers: > > - move Newsgroups to X-Original-Newsgroups > - create new Newsgroups (to direct post to another group) > - maybe modify Subject (to add original group(s) name to it) > > And then accept the article. As Ray Banana said, that's not possible. > If it's not possible, then at least I'd like to save the article to a file > before rejecting it (and post-process and repost it later, in the same way > I did with NoCeM-cancelled posts). Is it possible from within a filter? Yes, just before rejecting the article, just open a file and write (or append) the article. https://www.eyrie.org/~eagle/software/inn/docs/hook-python.html Take all the header fields which are not empty from the art dictionary, and then write art['__BODY__'] as the body. Also, as said, it may eat CPU cycles and slow innd down. Worth trying though, depending on how many articles you receive per second and how fast your system is. -- Julien ÉLIE « Que l'on serve notre boisson nationale, le calva, dans des crânes de vaincus ! » (Astérix)
Technical Details
Message-ID:
<uh8n89$renl$1@news.trigofacile.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mailReferences:
<uh70bm$hfd$1$arnold@news.chmurka.net> <uh86d5$r6ru$1@news.trigofacile.com> <uh89ms$vah$3$arnold@news.chmurka.net>Show Full Headers
Complete Article Headers
Message-ID: <uh8n89$renl$1@news.trigofacile.com> Subject: Re: inn: both Perl and Python filtering at the same time Date: Tue, 24 Oct 2023 17:18:33 +0200 From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> References: <uh70bm$hfd$1$arnold@news.chmurka.net> <uh86d5$r6ru$1@news.trigofacile.com> <uh89ms$vah$3$arnold@news.chmurka.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!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: Tue, 24 Oct 2023 15:18:33 -0000 (UTC) Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="176-143-2-105.abo.bbox.fr:176.143.2.105"; logging-data="899829"; mail-complaints-to="abuse@trigofacile.com" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:1xCncPWl4U2Y8g/bQmNrUqVd3bs= sha256:fddyWAXhdWCOS4ysyCDMIYnoTVcS/jolmobR72huAr8= sha1:eFNuxvEMR/JtwsBunXeykUEOLCY= sha256:bdw1okisXf8shZjZ1LN8NrgyjwPQ/CAEbE6mpkBfuTU= In-Reply-To: <uh89ms$vah$3$arnold@news.chmurka.net>