Perl filtering -> INN 2.2.2 (rewriting headers)

Johannes Verelst johannes at verelst.net
Tue Jun 27 18:32:19 UTC 2000


Hello

As the topic says: my question is about rewriting headers of news
articles with a perl script. I've got perl scripting up and running, and
my approach was the following:

from the '~news/bin/filter/' subdir I edit the 'filter_innd.pl' file.
The comment says:

#  sub filter_art { ... }
#
#      This routine is called before every article is accepted for
#      for posting. Is is called with no arguments, but has access to
#      all the non-empty standard headers of the article via the
#      global associative array `%hdr.'  If it returns the empty
#      string ("") then the article is accepted. If it returns any
#      non-null string value, then the article is rejected and the
#      returned string value is logged as the reason why.
#

But unfortunately writing the '%hdr' assoc. array has no effect. For
instance:
 $hdr{'Subject'} = "blah";
does nothing.

I checked if it works at all, and if I return a non-null string I do get
the desired behaviour, so the script does run. 

Is there an other way to rewrite header fields from an incoming
newsarticle? The posts are not local, they come through an tcp/ip
connection.

I hope that somebody can help me with it.

Regards,

Johannes verelst
--
If code was hard to write, it should be hard to read.



More information about the inn-workers mailing list