🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #53935

Re: 441 Can't set system "X-Trace" header

#53935
From: John W. Krahn
Date: Thu, 23 Aug 2001 07:56
64 lines
2650 bytes
madog wrote:
> 
> "Russ Allbery" <rra@stanford.edu> wrote in message
> news:ylsnejvbq5.fsf@windlord.stanford.edu...
> | In news.software.nntp, madog <madog@madogcc.myip.org> writes:
> |
> | > any idea how to fix this problme ? thanks !
> |
> | Strip out the X-Trace header before posting articles to remote servers.
> 
> thanks, but i think this script is used to do the "strip" job,  is there
> anything i need to modify ?
> (i don't understand script language)
> 
> [root@madogcc /tmp]# more put.news.sm
> #!/bin/sh
> 
> # this is just a simple script to use sed to strip off the
> # NNTP_Posting_Host and Xref headers that my ISP's newsfeed
> # doesn't like.
> # It is set up for INND using CNFS, so it uses the sm command
> # to get the actual article
> 
> TMPFILE=/tmp/tmp$$
> SEDCMD="/^NNTP-Posting-Host/d"
> SEDCMD2="/^Xref/d"
> OUTFILE=$2
> 
> /usr/bin/sm $1 > $TMPFILE
> 
> if [ -f ${TMPFILE} ]; then
> 
>         sed -e ${SEDCMD} ${TMPFILE} | sed -e ${SEDCMD2} > ${OUTFILE}
> 
>         if [ $? -ne 0 ]; then
>                 echo "Error"
>                 exit -1
>         fi
> 
>         rm ${TMPFILE}
> fi

If you want to do it in Perl  :-)


#!/usr/bin/perl -w
use strict;

die "usage: $0 article outfile\n" unless @ARGV == 2;
open OUT, "> $ARGV[1]" or die "Cannot write to $ARGV[1]: $!";
for ( `/usr/bin/sm $ARGV[0]` ) {
    print OUT unless /^NNTP-Posting-Host/ or /^Xref/;
    }

__END__



John
-- 
use Perl;
program
fulfillment
Technical Details
Message-ID: <3B84B797.CE07761C@acm.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.admin.misc.mbox.zip!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!torn!newsfeed.telusplanet.net!news1.telusplanet.net.POSTED!not-for-mail
References: <9m1glq$b90$1@mail.cn99.com> <ylsnejvbq5.fsf@windlord.stanford.edu> <9m1p8d$glh$1@mail.cn99.com>

Show Full Headers
Complete Article Headers
Message-ID: <3B84B797.CE07761C@acm.org>
Subject: Re: 441 Can't set system "X-Trace" header
Date: Thu, 23 Aug 2001 07:56:25 GMT
From: "John W. Krahn" <krahnj@acm.org>
References: <9m1glq$b90$1@mail.cn99.com> <ylsnejvbq5.fsf@windlord.stanford.edu> <9m1p8d$glh$1@mail.cn99.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.admin.misc.mbox.zip!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!torn!newsfeed.telusplanet.net!news1.telusplanet.net.POSTED!not-for-mail
X-Mailer: Mozilla 4.78 [en] (X11; U; Linux 2.4.4-4GB i586)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: news.software.nntp,comp.os.linux.misc,news.admin.misc
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 63
NNTP-Posting-Host: 216.232.21.45
X-Trace: news1.telusplanet.net 998553385 216.232.21.45 (Thu, 23 Aug 2001 01:56:25 MDT)
NNTP-Posting-Date: Thu, 23 Aug 2001 01:56:25 MDT