C News msgids script

Urko Lusa (ulusa@arrakis.es)
Fri, 4 Oct 1996 07:06:26 +0100 (MET)

Hello people.

Some days ago I posted to the list asking for a way to change the msgid
of articles to the classic FTN way in a C News system. As my C News
distribution doesn't have the anne.jones file, I did this script which
changes articles in the in.coming directory. It's intended to be executed
before newsrun, as user news. It is not very elegant, but it seems to
work with my ifmail 2.8e-tx7.5

Note: this just changes the articles which are going to the xtau
hierarchy, but you can change it easily to use the fido groups.

----------------------------------------------------------------------
#!/bin/sh
#
# Create a xtauname file in $NEWSCTL with your addres in
# p1.f2.n345.z67.xtau.org format
#

COMING=/var/spool/news/in.coming
NEWSCTL=/var/lib/news

if test -r $NEWSCTL/xtauname; then
xtauname="`tr -d ' \11' <$NEWSCTL/xtauname`"
else
echo $NEWSCTL/xtauname not found
exit 1
fi

if test -r $NEWSCTL/mailname; then
mailname="`tr -d ' \11' <$NEWSCTL/mailname`"
else
echo $NEWSCTL/mailname not found
exit 1
fi

for fichero in `find $COMING -name 0.\*` ; # solo msjs locales
do
if grep Newsgroups: $fichero | grep -q xtau\. # es de la jerarquía
then
linea=`grep -n Message-ID: $fichero | cut -b -3 - | tr -d [:alpha:][:punct:]`
temporal=/tmp/cambia-msgids.$$
mv $fichero $temporal
sed ${linea}s/$mailname/$xtauname/1 $temporal > $fichero
rm -f $temporal
fi
done
----------------------------------------------------------------------

Saludos, Urko.