🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #41862

Filter & BODY Re-write

#41862
From: Edward Siewick
Date: Tue, 30 Nov 1999 00:00
46 lines
2527 bytes
Hi.  I'm looking for a way to re-write some NNTP headers and more
importantly some aspects of the message BODY on a specific in-coming feed. 
The filter_innd.pl mechanism is the wrong place.  Is there a "right" or
"best" way to handle this sort of requirement?

I'm dealing with a non-public newsfeed of about 100 newsgroups.  Traffic is
a few dozen posts per hour, primarily gateway'd from 350 non-Usenet sites
running Macintosh-based FirstClass servers.  The gateway unfortunately does
not properly handle MIME attachments.  The attachments themselves are OK;
it's the envelop that's FUBAR'd.  For _everything_ it's

# Content-Type: text/plain; charset=ISO-8859-1

instead of 

# Content-Type: multipart/mixed; boundary="---whatever"

Buried in the body, the attachments are introduced as so:

# Content-Type: image/gif; name="bg.gif"
# Content-Transfer-Encoding: base64
# Content-Disposition: inline; filename="bg.gif"

Obviously, it'd be best if this were fixed at the sending gateway.  But it's
taken about five years for the folks with the FC gateway to get this far. 
I'm not much interested in waiting another five years to see the MIME
attachments fixed.

So I'm thinking the most expedient approach would be to just convert
everything from this feed arriving as "Content-Type: text/plain" to
multipart/mixed, wrap the BODY in MIME boundaries, also tossing in a
boundary if ^Content-Type: appears in the BODY.  But where does such a thing
get added?  I know I can filter outbound items in newsfeeds with something
modeled after news2mail.  Do I just send everything in this feed to myself? 
Without duplicating?

Clues, hints, comments, canned solutions all welcome.

Edward Siewick
-- 
  ESiewick 'a' DigiPro.com           DigiPro Digital Productions, LLC
  Voice:  703-522-8465                   3100 North Quincy Street
  Fax:    703-522-8417                  Arlington, Virginia  22207


Technical Details
Message-ID: <81vqc3$3d8$1@www.digipro.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <81vqc3$3d8$1@www.digipro.com>
Subject: Filter & BODY Re-write
Date: Tue, 30 Nov 1999 00:00:00 +0000
From: Edward Siewick <esiewick@no-no-spam.digipro.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 554752608
Organization: DigiPro Digital Productions
User-Agent: tin/pre-1.4-19990216 ("Styrofoam") (UNIX) (Linux/2.2.12 (i586))
Newsgroups: news.software.nntp