🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #69054

mail2news script

#69054
From: Habu
Date: Sun, 25 Apr 2004 08:54
30 lines
1858 bytes
Hello,
I'm trying to tweek a perl script that was originally written by Rich
Saltz for posting messages from mailing lists to a newsgroup.  Rich's
script works very nicely but I have encountered one issue with it:

Some messages are being sent to mailing lists and crossposted to a
mail2news gateway, as per the following example:

# To: list@somesite.com
# Cc: mail2news@demon.co.uk
# Newsgroups: alt.test

If I host alt.test on my news server and also want to post
list@somesite.com messages to local.list.somesite, I end up with a
duplicated Message-ID.

To overcome this problem, I decided to prefix the Message-ID with 'list'
so that <abc@def.com> becomes <list.abc@def.com> prior to posting it to
my local group.  Having almost zero knowledge of Perl, I used the
following regex:
s/Message-ID:\s<+(.*)/Message-ID: <list\.$1/

My problem now is with the References that also need to have the same
prefix applied or I break threading.  My above regex doesn't work as
there can be more than one reference within the header.  And so finally
to my question!  Could anyone suggest a Perl method for adding a prefix
to all the message-id's within a References header?


Technical Details
Message-ID: <c6fubi$pob$1@bananasplit.info>
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!archiver1.google.com!news1.google.com!news.glorb.com!news.bananasplit.info!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <c6fubi$pob$1@bananasplit.info>
Subject: mail2news script
Date: Sun, 25 Apr 2004 08:54:10 +0000
From: Habu <blackbird@invalid.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!archiver1.google.com!news1.google.com!news.glorb.com!news.bananasplit.info!not-for-mail
Newsgroups: news.software.nntp
Organization: Bananasplit
Lines: 29
X-Complaints-To: abuse@bananasplit.info
NNTP-Posting-Date: Sun, 25 Apr 2004 08:54:10 +0000 (UTC)
User-Agent: slrn/0.9.7.4 (Linux)