Article View: news.software.nntp
Article #84405Re: INN's mailpost script - requested change.
From: D. Stussy
Date: Tue, 27 Sep 2011 23:55
Date: Tue, 27 Sep 2011 23:55
41 lines
3040 bytes
3040 bytes
"Julien ΓLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message
news:j5thbn$7j6$1@news.trigofacile.com...
> >>> 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 ("...")?
> >>
> >> Why not just remove the invalid header? (998 bytes without seeing
> >> any CRLF)
> >
> > That could be done, but I thought that the idea was to preserve as
> > much as possible from the original message....
>
> Sure, you're right.
>
> Couldn't we use Text::Wrap, which is a Perl core module to achieve that?
> It defaults to wrap to 76 columns, after a space ("\s"), with "\n"
> (which is fine because mailpost uses mere LF "\n" too). If a word is
> more than 76 columns, then it is wrapped at multiples of its 76th chars
> (which is probably fine, even for base64-encoded headers).
>
> I suggest to just call the function after a header field has been filled
> into $line.
> $line is something like "Header: text\n text\n text".
>
> $line = Text::Wrap::wrap("", "\t", $line);
I think that's the way to go. We could also wrap at 998.
> Maybe we should also remove lines containing only whitespace characters
> afterwards, just to be sure the header is valid?
>
> $line =~ s/\n[ \t]*\n/\n/g;
> $line =~ s/\n[ \t]*$//;
A completely blank line separates headers from body.... Did you mean
trailing whitespace?
Technical Details
Message-ID:
<j5tnpe$d5r$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.ams3.giganews.com!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news.unit0.net!news1.dtag.de!news.csl-gmbh.net!news.linkpendium.com!news.linkpendium.com!news.snarked.org!pool-71-106-211-51.lsanca.dsl-w.verizon.net!not-for-mailReferences:
<j5e6c0$8ib$1@snarked.org> <j5g860$9qe$1@news.trigofacile.com> <j5ggc9$q20$1@snarked.org> <j5thbn$7j6$1@news.trigofacile.com>Show Full Headers
Complete Article Headers
Message-ID: <j5tnpe$d5r$1@snarked.org> Subject: Re: INN's mailpost script - requested change. Date: Tue, 27 Sep 2011 16:55:26 -0700 From: "D. Stussy" <spam+newsgroups@bde-arc.ampr.org> References: <j5e6c0$8ib$1@snarked.org> <j5g860$9qe$1@news.trigofacile.com> <j5ggc9$q20$1@snarked.org> <j5thbn$7j6$1@news.trigofacile.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.20141118.mbox.gz!border1.nntp.ams3.giganews.com!border1.nntp.ams2.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news.unit0.net!news1.dtag.de!news.csl-gmbh.net!news.linkpendium.com!news.linkpendium.com!news.snarked.org!pool-71-106-211-51.lsanca.dsl-w.verizon.net!not-for-mail Newsgroups: news.software.nntp Lines: 41 Reply-To: "D. Stussy" <replies@newsgroups.kd6lvw.ampr.org> Injection-Date: Tue, 27 Sep 2011 23:55:26 +0000 (UTC) Injection-Info: snarked.org; posting-host="pool-71-106-211-51.lsanca.dsl-w.verizon.net:71.106.211.51"; logging-data="13499"; 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: 2762