Parsing unknown, Pine-related text files
February 4, 2014 9:05 AM Subscribe
I inherited a bunch of text files that correspond to e-mails, probably generated using Pine or a variant. I know nothing about Pine. More inside!
A sample header of a file looks like this:
*mbx*
49b56a720000014b
PaulR
wait
TomG
$Forwarded
ACTION
urgent
reference
Elliott
Task
Inside this text file there appears to be pdf and doc files as attachments. How can I pull them out using Windows 7? It seems my two choices are: 1) find something that will convert the text file into a pst file, or 2) edit down to the attachment as a text file and somehow convert it back into a pdf or doc file.
Thanks in advance!
A sample header of a file looks like this:
*mbx*
49b56a720000014b
PaulR
wait
TomG
$Forwarded
ACTION
urgent
reference
Elliott
Task
Inside this text file there appears to be pdf and doc files as attachments. How can I pull them out using Windows 7? It seems my two choices are: 1) find something that will convert the text file into a pst file, or 2) edit down to the attachment as a text file and somehow convert it back into a pdf or doc file.
Thanks in advance!
Best answer: mbox format is not the same as mbx format (and Pine's mbx format is not the same as Outlook's mbx format).
I think your options 1 and 2 will both be difficult, because there aren't a whole lot of tools for working with mbx. I would recommend installing Alpine on Windows (which is what Pine is now called, to confuse you), and using that to open the mbx files.
If you'd like me to try opening one in my Alpine to see if that'll work, I'm happy to.
posted by Eater at 9:34 AM on February 4, 2014
I think your options 1 and 2 will both be difficult, because there aren't a whole lot of tools for working with mbx. I would recommend installing Alpine on Windows (which is what Pine is now called, to confuse you), and using that to open the mbx files.
If you'd like me to try opening one in my Alpine to see if that'll work, I'm happy to.
posted by Eater at 9:34 AM on February 4, 2014
It's possible to parse these out with shell/Perl scripts -- I processed about a decade's worth of a mailing list archive once, and it was awful -- but I would agree that a real mail client would allow you to open them and browse them and extract the attachments.
posted by wenestvedt at 10:49 AM on February 4, 2014
posted by wenestvedt at 10:49 AM on February 4, 2014
If these are actually uw "mbx" format files and you have access to a unix/linux system, you can convert them to "maildir", which is one-file-per-message. One set of instructions I found is here.
You can also convert a mbx file to mbox, which is a more standard format for multiple messages per file. Each new message begins on a line which starts "From ". Again on a Linux/Unix machine with program "mailutil" installed (package uw-mailutils on Debian 7):
Reportedly, "mailutil copy" has a syntax to put the messages in any imap mailbox, but I didn't try/test this.
posted by jepler at 1:33 PM on February 4, 2014
You can also convert a mbx file to mbox, which is a more standard format for multiple messages per file. Each new message begins on a line which starts "From ". Again on a Linux/Unix machine with program "mailutil" installed (package uw-mailutils on Debian 7):
mailutil create outboxwith appropriate values for yourmbxfile (the input) and outbox (the output). mailutil seems to insist on operating on files in your home directory, not any other location.
mailutil copy '#driver.mbx/yourmbxfile' outbox
Reportedly, "mailutil copy" has a syntax to put the messages in any imap mailbox, but I didn't try/test this.
posted by jepler at 1:33 PM on February 4, 2014
Response by poster: Installing Alpine and loading individual files via the command line using -f did the trick, as suggested by Eater. Thanks to all who answered!
posted by Napoleonic Terrier at 2:14 PM on February 4, 2014
posted by Napoleonic Terrier at 2:14 PM on February 4, 2014
This thread is closed to new comments.
posted by effigy at 9:12 AM on February 4, 2014 [1 favorite]