Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What's wrong with this mtx script

9 views
Skip to first unread message

Howard Schwartz

unread,
May 10, 2013, 1:55:28 AM5/10/13
to
I wrote the following sed script to convert Pine's mtx format in windows
to the unix, mbox format. Pine responds by opening the converted file,
but with 0 messages. What am I doing wrong? My only thought is that the
new Unix style, From lines must be to the real person, not a dummy
variable.

Here's the strategy:

a)First replace all the From lines in a message body with an escape
character so they are not mistaken for the beginning of a message

b) Next delete the initial mtx data of each file the the internal
initiation data recommended by Pine.

c) Now replace all the date lines that describing the number of bytes in
each message, with the new Unix style From lines, prepended by a blank
line

d) Finally remove ctrl-M characters, converting dos style EOL (end of
line characters) with the unix style


/^From /s/^From/>&/
1,/;00000/c\
From MAILER-DAEMON Thu Feb 10 16:15:09 2011\
Date: 10 Feb 2011 16:15:09 -0800\
From: Mail System Internal Data <MAILER-DAEMON@YDhYY5QP>\
Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA\
Message-ID: <1297383309@YDhYY5QP>\
X-IMAP: 1297382510 0000000100\
Status: RO\
\
This text is part of the format of your mail folder, and is not\
a real message. It is created automatically by the mail system
software.\ If deleted, important folder data are lost, and it will be
re-created\ with the data reset to initial values.\
\
From Default
/;00000.*-/s/^.*$/\nFrom Default/
s/^M//


Lucas Levrel

unread,
May 10, 2013, 4:47:02 AM5/10/13
to
Le 10 mai 2013, Howard Schwartz a ᅵcrit :

> My only thought is that the new Unix style, From lines must be to the
> real person, not a dummy variable.

I don't think so: I have old messages, sent from an old address of mine,
which doesn't show up in my config anymore. How could Alpine know they're
from "a real person"? (The adress is different in the From and From:
lines.)

On the other hand, the From lines I see all contain a date, which I think
is the Arrival date. E.g.:
From foo@bar Mon Jan 24 15:06:25 2000 +0200
Date: Mon, 24 Jan 2000 15:06:25 +0100 (MET)
From: Foo <dummy>

Note Arrival is not always equal to Date. (This one is from my sent-mail.)
So maybe a dummy date would do the trick on the From lines.

--
LL

Adam H. Kerman

unread,
May 10, 2013, 8:31:28 AM5/10/13
to
Pine creates From as mailbox message boundary so that it contains a date
and time stamp of when it was received locally. The purpose is to prevent
confusion with a line in the message body that starts with "From ". Any
time stamp in valid syntax will do.

Howard Schwartz

unread,
May 10, 2013, 5:49:48 PM5/10/13
to
"Adam H. Kerman" <a...@chinet.com> wrote in news:kmipb0$3tu$4
@news.albasani.net:

> Pine creates From as mailbox message boundary so that it contains a
date
> and time stamp of when it was received locally. The purpose is to
prevent
> confusion with a line in the message body that starts with "From ". Any
> time stamp in valid syntax will do.

Thanks for the tip. But I may have discovered something that makes my
script unnecessary. I learned how to make mailutil.exe work reliably, at
least in XP.

For SOME reason if one places mtx style files, or mailboxes in this
directory: C:\Documents and Settings\Administrator
mailutil.exe behaves perfectly, with the commands working as they might
in a unix envirnment. For example

mailutil copy file.mtx #driver.unix\file2.mbox

works just fine now.

There is no mention of this directory in the command line or version
screens, help documents, references to HOME, PINERC or PINECONF variables
etc. Perhaps, little thought was given
to the correspondings between the unix server/client environments --
something to do with administrative privileges and why alpine thinks this
directory is so special (I already run as administrator in all
directories).

But this is a Great discovery. The tool allows one to reorganize folders
prune messages and all sorts of other useful things. Perhaps all that is
needed is to get the folders in that administrator's directory, or even
do it temporarily with a juncture or symbolic link.

Thought this was worth sharing with those that may have need of
mailutil.exe functions.

0 new messages