Article View: news.software.nntp
Article #88739Re: mbox archive for a news server
From: Grant Taylor
Date: Wed, 25 Aug 2021 15:44
Date: Wed, 25 Aug 2021 15:44
27 lines
2242 bytes
2242 bytes
On 8/24/21 11:29 AM, Todd Michel McComb wrote:
> formail can be used to add mail headers such as From.... You could
> process through formail and then just 'cat' straight to an mbox file.
I want to agree. But I have concerns.
I believe that formail habitually /appends/ new headers to the existing
headers. Seeing as how the From line is used as a message separator in
mbox format, it /MUST/ be the first header. I'm not sure that formail
in and of itself can /prepend/ / insert a header at the start of a message.
I suspect that it might be better to use formail to extract the From:
header, mung it to fabricate a From separator line contents, and then
prepend it to the message. E.g. do something like the following:
for message in /path/to/desired/articles/*; do
NewFrom=$(cat $message | formail -x From: | $CommandToReformat)
echo "" >> /path/to/archive
echo "From $NewFrom" >> /path/to/archive
cat $message >> /path/to/archive
done
--
Grant. . . .
unix || die
Technical Details
Message-ID:
<sg5om3$8m1$1@tncsrv09.home.tnetconsulting.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mailReferences:
<sfvheu$o2u$1@theuse.news.theuse.net> <slrnsi8faf.rkt.theise@panix2.panix.com> <sg1seq$va9$1@tncsrv09.home.tnetconsulting.net> <slrnsiaar2.68d.theise@panix2.panix.com> <sg3a9g$qio$1@hope.eyrie.org>Show Full Headers
Complete Article Headers
Message-ID: <sg5om3$8m1$1@tncsrv09.home.tnetconsulting.net> Subject: Re: mbox archive for a news server Date: Wed, 25 Aug 2021 09:44:15 -0600 From: Grant Taylor <gtaylor@tnetconsulting.net> References: <sfvheu$o2u$1@theuse.news.theuse.net> <slrnsi8faf.rkt.theise@panix2.panix.com> <sg1seq$va9$1@tncsrv09.home.tnetconsulting.net> <slrnsiaar2.68d.theise@panix2.panix.com> <sg3a9g$qio$1@hope.eyrie.org> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail Newsgroups: news.software.nntp Organization: TNet Consulting Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 25 Aug 2021 15:47:15 -0000 (UTC) Injection-Info: tncsrv09.home.tnetconsulting.net; posting-host="alpha.home.tnetconsulting.net:198.18.18.251"; logging-data="8897"; mail-complaints-to="newsmaster@tnetconsulting.net" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 In-Reply-To: <sg3a9g$qio$1@hope.eyrie.org> Content-Language: en-US Lines: 26