Thread View: news.software.nntp
11 messages
11 total messages
Started by `matte
Fri, 29 Jun 2001 14:51
INN: Perl filtering on Subject
Author: `matte
Date: Fri, 29 Jun 2001 14:51
Date: Fri, 29 Jun 2001 14:51
61 lines
2500 bytes
2500 bytes
Hi, I want enable perl filtering in filter_innd.pl, but I have read the
documentation, and it says :
--------------
The %hdr hash should not be modified inside filter_art(). Instead,
any of the contents need to be modified temporarily during filtering
(smashing case, for example), copy them into a seperate variable first
and perform the modifications on the copy. Currently, `$hdr{__BODY__}'
---------------
I'm not understanding the right way to modify my headers. I have tried
to make a copy to another variable, but it doesn works...
I'm working on filter_art() in filter_innd.pl, but when I try to
put the spoolfile into innd, filter_art() has no effect on subjects.[1]
Wrong Subjects are correctly recognized by filter, but they are not
corrected...
Instead, filter_nnrpd.pl works correctly. When a message is posted
locally, if it has malformed subject, it is correctly recognized and
corrected.
And now, the code:
----------
sub filter_art {
my $rval = "" ; # Assume we'll accept.
$modify_headers = 1; # I dont know if it is necessary
if ($hdr{"Subject"} =~ /^(RE: |Re: |R: ){2,}/) {
$hdr{"Subject"} =~ s/(RE: |Re: |R: ){2,}/Re: /;
} elsif ($hdr{"Subject"} =~ /^R: /) {
$hdr{"Subject"} =~ s/^R: /Re: /;
} elsif ($hdr{"Subject"} =~ /^RE: /) {
$hdr{"Subject"} =~ s/^RE: /Re: /;
}
$rval ;
}
-------------
That's all ;-))
[1] I'm using ``rnews spoolfile'' to put my spool in INNd.
Bye, `matte.
ps: Sorry, but I am a newbie with perl scripting ;-))
pps: SOrry for my English :P
--
err: signature too big
Re: INN: Perl filtering on Subject
Author: Marco d'Itri
Date: Fri, 29 Jun 2001 15:10
Date: Fri, 29 Jun 2001 15:10
14 lines
1522 bytes
1522 bytes
fake@address.com wrote: >I'm not understanding the right way to modify my headers. I have tried You can't modify anything inside filter_art(), you have to use filter_nnrpd.pl (yes, I'm going to rewrite R: for my users). > $modify_headers = 1; # I dont know if it is necessary It's not even useful, you are confusing the two interfaces. -- ciao, | Marco | * The Internet is full. Go away. -- Joel Furr *
Re: INN: Perl filtering on Subject
Author: Andrew Gierth
Date: Fri, 29 Jun 2001 15:28
Date: Fri, 29 Jun 2001 15:28
22 lines
1861 bytes
1861 bytes
>>>>> "matte" == `matte <fake@address.com> writes:
matte> Hi, I want enable perl filtering in filter_innd.pl, but I have
matte> read the documentation, and it says :
matte> --------------
matte> The %hdr hash should not be modified inside filter_art().
matte> Instead, any of the contents need to be modified temporarily
matte> during filtering (smashing case, for example), copy them into
matte> a seperate variable first and perform the modifications on the
matte> copy. Currently, `$hdr{__BODY__}'
matte> ---------------
matte> I'm not understanding the right way to modify my headers.
It's not possible to modify the actual headers of an article in
filter_innd.pl. Modification of headers of articles in transit is a
definite no-no.
--
Andrew.
Re: INN: Perl filtering on Subject
Author: `matte
Date: Fri, 29 Jun 2001 15:52
Date: Fri, 29 Jun 2001 15:52
17 lines
1328 bytes
1328 bytes
* On the 180th day of the year, Andrew Gierth was talking about... > matte> I'm not understanding the right way to modify my headers. > > It's not possible to modify the actual headers of an article in > filter_innd.pl. Modification of headers of articles in transit is a > definite no-no. I understand. Are there any other ways to do this? Or it is simply impossible (without hacking ;-) )? Thanks. Bye, `matte. -- err: signature too big
Re: INN: Perl filtering on Subject
Author: `matte
Date: Fri, 29 Jun 2001 15:59
Date: Fri, 29 Jun 2001 15:59
10 lines
1208 bytes
1208 bytes
>> Modification of headers of articles in transit is a definite no-no. I want only add that I'm on a home-pc. I understand that header modification isn't a good thing, but I hate "R:" ;-))) Ciao, `matte. -- err: signature too big
Re: INN: Perl filtering on Subject
Author: `matte
Date: Fri, 29 Jun 2001 16:09
Date: Fri, 29 Jun 2001 16:09
22 lines
1679 bytes
1679 bytes
* On the 180th day of the year, Marco d'Itri was talking about... >>I'm not understanding the right way to modify my headers. I have tried > You can't modify anything inside filter_art(), you have to use Ok. > filter_nnrpd.pl (yes, I'm going to rewrite R: for my users). Yes, but I haven't found a good solution for this. Only the articles posted locally are rewritten. I would want that also the articles inserted by rnews were rewritten. Is it possible? >> $modify_headers = 1; # I dont know if it is necessary > It's not even useful, you are confusing the two interfaces. Yes, $modify_header is helpful only in filter_nnrpd.pl, is it true? Bye, `matte. -- err: signature too big
Re: INN: Perl filtering on Subject
Author: meowbot
Date: Fri, 29 Jun 2001 19:39
Date: Fri, 29 Jun 2001 19:39
14 lines
1565 bytes
1565 bytes
In article <slrn9jp9f1.7p2.fake@mat.home.xs>, `matte says... > >>> Modification of headers of articles in transit is a definite no-no. > >I want only add that I'm on a home-pc. I understand that header >modification isn't a good thing, but I hate "R:" ;-))) I really think you'd be better off teching slrn to massage the article for you. It it's only replies/followups you want to clean up, you can even do it in an editor wrapper script in your language of choice without touching the newsreader itself.
Re: INN: Perl filtering on Subject
Author: `matte
Date: Fri, 29 Jun 2001 20:13
Date: Fri, 29 Jun 2001 20:13
15 lines
1608 bytes
1608 bytes
* On the 180th day of the year, meowbot@meowing.net was talking about... > I really think you'd be better off teching slrn to massage the article for > you. It it's only replies/followups you want to clean up, you can > even do it in an editor wrapper script in your language of choice without > touching the newsreader itself. Ehm, I would want than the server do it :\ If it isn't possible with INN, I think that I'll use newsx --filter option. Bye, `matte. -- err: signature too big
Re: INN: Perl filtering on Subject
Author: Russ Allbery
Date: Fri, 29 Jun 2001 22:19
Date: Fri, 29 Jun 2001 22:19
14 lines
1460 bytes
1460 bytes
`matte <fake@address.com> writes:
> I understand. Are there any other ways to do this? Or it is simply
> impossible (without hacking ;-) )?
There isn't any way to do this in INN without reasonably extensive
modifications to the Perl glue code in innd.
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: INN: Perl filtering on Subject
Author: `matte
Date: Fri, 29 Jun 2001 23:04
Date: Fri, 29 Jun 2001 23:04
14 lines
1322 bytes
1322 bytes
* On the 180th day of the year, Russ Allbery was talking about... >> I understand. Are there any other ways to do this? Or it is simply >> impossible (without hacking ;-) )? > > There isn't any way to do this in INN without reasonably extensive > modifications to the Perl glue code in innd. Thanks Russ. I understand :( Bye, `matte. -- err: signature too big
Re: INN: Perl filtering on Subject
Author: bill davidsen
Date: Mon, 09 Jul 2001 18:42
Date: Mon, 09 Jul 2001 18:42
18 lines
1939 bytes
1939 bytes
In article <slrn9jpa1f.7r8.fake@mat.home.xs>, `matte <fake@address.com> wrote: | Yes, but I haven't found a good solution for this. | Only the articles posted locally are rewritten. I would want that also | the articles inserted by rnews were rewritten. Is it possible? | | >> $modify_headers = 1; # I dont know if it is necessary | > It's not even useful, you are confusing the two interfaces. The reason it works this way is that you have the right to modify the things posted on your server, but you should never rewite outside posts, just accept or reject. -- bill davidsen <davidsen@tmr.com> CTO, TMR Associates, Inc "I am lost. I am out looking for myself. If I should come back before I return, please ask me to wait." -seen in a doctor's office
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads