🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #84287

INN's mailpost script - requested change.

#84287
From: D. Stussy
Date: Thu, 22 Sep 2011 02:26
29 lines
2172 bytes
"A single header field line is limited to 998 bytes."

I have noted that some mail headers (which always end up being added to the
"weird_mail_hdrs" variable) exceed this limit, especially those which
relate to headers added by spam detection (e.g. a list of spam rules which
fired).  Would it be possible to modify any header added to this variable
to truncate them at 995 bytes plus elipsis ("...")?

I know that detection of the case is easy.  About line 312:

    # Random unknown header.  Prepend 'X-' if it is not already there.
    $_ = "X-$_" unless /^X-/sio ;

+   If length($_) > 998 then ....

    $weird_mail_hdrs .= "$_\n";


However, my perl skills aren't extensive enough to know the proper way to
actually perform the truncation.
It should be something like:

    $_  = left($_,995) . "...";

I thought about considering alteration of ALL headers, but decided it was
only really important for those headers which as a news article would be
prefixed with "X-".

Technical Details
Message-ID: <j5e6c0$8ib$1@snarked.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.bnb-lp.com!news.glorb.com!news.snarked.org!pool-71-106-211-51.lsanca.dsl-w.verizon.net!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <j5e6c0$8ib$1@snarked.org>
Subject: INN's mailpost script - requested change.
Date: Wed, 21 Sep 2011 19:26:09 -0700
From: "D. Stussy" <spam+newsgroups@bde-arc.ampr.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca3.giganews.com!border2.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.bnb-lp.com!news.glorb.com!news.snarked.org!pool-71-106-211-51.lsanca.dsl-w.verizon.net!not-for-mail
Newsgroups: news.software.nntp
Lines: 29
Reply-To: "D. Stussy" <replies@newsgroups.kd6lvw.ampr.org>
Injection-Date: Thu, 22 Sep 2011 02:26:08 +0000 (UTC)
Injection-Info: snarked.org;
 posting-host="pool-71-106-211-51.lsanca.dsl-w.verizon.net:71.106.211.51";
 logging-data="8779"; mail-complaints-to="newsmaster+complaints@snarked.org"
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1478
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1478
X-Original-Bytes: 1970