Article View: news.software.nntp
Article #84408Re: INN's mailpost script - requested change.
From: Julien ÉLIE
Date: Wed, 28 Sep 2011 17:34
Date: Wed, 28 Sep 2011 17:34
43 lines
2654 bytes
2654 bytes
Hi Dieter,
>> 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.
We should indeed force a wrapping at 998.
(Message-IDs can contain up to 250 bytes -- a wrap at 76 would break them.)
>> 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?
I mean blank lines (zero or more whitespace characters) in folded header
fields like:
Subject: Test\n
line 2\n
\n
line 4
(or with "\r\n" -- mailpost uses only "\n" internally)
The third line should be removed. (I think using Text::Wrap might
introduce such lines, in a few edge cases.)
I do not plan on altering the body with a wrap at 998. Just headers.
--
Julien ÉLIE
« – Où vous croyez-vous ici ?
– Où je me trouve, je sais. » (Astérix)
Technical Details
Message-ID:
<j5vlqk$4o0$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.stben.net!news.trigofacile.com!.POSTED.aaubervilliers-552-1-145-66.w81-249.abo.wanadoo.fr!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> <j5tnpe$d5r$1@snarked.org>Show Full Headers
Complete Article Headers
Message-ID: <j5vlqk$4o0$1@news.trigofacile.com> Subject: Re: INN's mailpost script - requested change. Date: Wed, 28 Sep 2011 19:34:12 +0200 From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> References: <j5e6c0$8ib$1@snarked.org> <j5g860$9qe$1@news.trigofacile.com> <j5ggc9$q20$1@snarked.org> <j5thbn$7j6$1@news.trigofacile.com> <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.stben.net!news.trigofacile.com!.POSTED.aaubervilliers-552-1-145-66.w81-249.abo.wanadoo.fr!not-for-mail Newsgroups: news.software.nntp Organization: TrigoFACILE -- http://www.trigofacile.com/ Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Wed, 28 Sep 2011 17:34:12 +0000 (UTC) Injection-Info: news.trigofacile.com; posting-host="aaubervilliers-552-1-145-66.w81-249.abo.wanadoo.fr:81.249.132.66"; logging-data="4864"; mail-complaints-to="abuse@trigofacile.com" User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.7; fr; In-Reply-To: <j5tnpe$d5r$1@snarked.org> Lines: 42 X-Original-Bytes: 2398