🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #69077

Re: Filtering headerlines when posting to newsgroups

#69077
From: pbs
Date: Tue, 27 Apr 2004 21:06
53 lines
2888 bytes
John wrote:
> I wonder if there are programs (freeware or shareware) available
> which can hide header line such as "X-MSMail-Priority: Normal",
> "X-Newsreader: Microsoft Outlook Express xxxxxxxxxx" and "X-MimeOLE:
> Produced By Microsoft MimeOLE xxxxxxxxxx".
> I am thinking of something similar to the smtp filter from
> http://lab1.de/Central/Software/Internet/E-Mail/SMTP-Filter/
> 
> Any hints would be appreciated.
> 
> John
> 
Here is a sed script to do it for you:

--------------X cut X------------------------
#!/bin/sh
sed -f sed_head_cmds -f sed_body_cmds <$1

# This above a simple shell script
# save the lines to a file
# chmod it to 755
# run it with one argument the output is to stdout
-----------------X cut X-----------------------
# This is the file sed_head_cmds
# Put the header lines you want to filter out below
/^X-MSMail-Priority:/d
/^X-MimeOLE:/d
-----------------X cut X-----------------------
#this is the file sed_body_cmds
#
# header lines filtered out by sed_head_cmds before getting here
#
# On the first none header (blank) line goto the "continue"
# label else start the sed scripts again with the next line
# of input
#
s/^$//
t continue
b end
##########
# do body of news message
#
# print out current line, read next, continue to loop and do
# this in this iteration of this sed script until the end of
# the input file
########
: continue
${
b end
}
n
b continue
: end
Technical Details
Message-ID: <c6mhvv$ifg$1@squay.lomarline.freeserve.co.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!number1.nntp.ash.giganews.com!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!nntp.giganews.com!elnk-atl-nf1!newsfeed.earthlink.net!c01.usenetserver.com!c03.atl99!news.usenetserver.com!news02.tsnz.net!news.iconz.co.nz!lomarline.freeserve.co.uk!not-for-mail
References: <c6e50t$bqh$1@newshispeed.ch>

Show Full Headers
Complete Article Headers
Message-ID: <c6mhvv$ifg$1@squay.lomarline.freeserve.co.uk>
Subject: Re: Filtering headerlines when posting to newsgroups
Date: Wed, 28 Apr 2004 09:06:07 +1200
From: pbs <pnews@lomarline.freeserve.co.uk>
References: <c6e50t$bqh$1@newshispeed.ch>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!number1.nntp.ash.giganews.com!internal1.nntp.ash.giganews.com!border2.nntp.ash.giganews.com!nntp.giganews.com!elnk-atl-nf1!newsfeed.earthlink.net!c01.usenetserver.com!c03.atl99!news.usenetserver.com!news02.tsnz.net!news.iconz.co.nz!lomarline.freeserve.co.uk!not-for-mail
Newsgroups: news.software.nntp
Organization: InterNetNews site lomarline.freeserve.co.uk
Lines: 53
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040113
X-Accept-Language: en, en-us
In-Reply-To: <c6e50t$bqh$1@newshispeed.ch>
X-Original-NNTP-Posting-Host: ip-210-185-6-174.internet.co.nz
X-Original-Trace: 28 Apr 2004 09:54:37 +1200, ip-210-185-6-174.internet.co.nz
NNTP-Posting-Host: 210.48.22.5
X-Complaints-To: abuse@tsnz.net
X-Trace: news02.tsnz.net 1083102976 210.48.22.5 (Wed,
NNTP-Posting-Date: Wed, 28 Apr 2004 09:56:16 NZST