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

Outlook to GNU/Linux mailbox conversion is possible with existing tools

2 views
Skip to first unread message

Dan Jacobson

unread,
Mar 1, 2001, 11:01:03 AM3/1/01
to
How I got my mail out of Outlook 2000 and Outlook Express 5 into GNU/Linux
without special tools By Dan Jacobson 3/2001
---------------------------------------------------------------

Below is me commenting on my earlier [D>] discussion. Below I've left
the steps a little loose... maybe somebody will polish this up. I
didn't try the IMAP thingy. I did try lots of windows programs
mentioned on webpages, that didn't work...
---------------------------------------------------------------

They say one needs fancy tools to extract ones Outlook 5 mail files
into say a Unix mbox format or whatever. However, I have found a
obscure passageway out.

D> Preliminary results on getting one's sent netnews messages [and
D> perhaps any other stuff in a .dbx file] out of the clutches of
D> Outlook and Outlook Express 5:

D> Goal: stop using M$ and get on GNU/Linux. Problem: I've got
D> several hundred of my brilliant netnews posts that I must take with
D> me if I want to keep my record of never having lost a byte of my
D> precious golden keystrokes intact. Email too, sent & received.

Can you believe were about to move our stuff from Outlook into Outlook
Express then into GNU/Linux.

Indeed, seemed like they sealed up plain Outlook2000 pretty good, but
wait, in Outlook Express I noticed I could "import" my plain Outlook
folders! Ah ha! Be sure to rename any Outlook Express folder of the
same name before you do this, else plain Outlook messages will be
copied into it alongside your original messages. Yuck.

Import steps were: [using the letter symbols, because I don't know
what the original English names are because I use the Chinese
version.] File (F)>I>E, select 'Microsoft outlook' (S), Messages,
select the plain Outlook folder to integrate or all, note that you will get
you messages intermingled with Outlook Express messages unless you first
renamed you Outlook Express folders. Yuck.

[brief interlude of me banging around inside the maze that they thought
they had sealed up:]

D> you control-click them [to select more than one, better yet,
D> there's a select all option on a menu] and then you got to the file
D> menu choice and discover that the 'save to file' choice is no
D> longer highlighted, ha ha they only allow you to save one file, no
D> problem: give up and instead now go to 'search' thru that folder [I
D> don't know the exact English menu names because I'm using the
D> Chinese version, plus too lazy to check], you search match all your
D> items, and again the save to file option's lights are out as you
D> have chosen more than one file, but not the forward option !!! ha
D> ha the chumps at M$ forgot to seal that off [Win98SE]! Conspiracy
D> failed! OK, so you 'send' all your news items in that folder as a
D> multi file attachment.... and save this unsent mail to disk.
D> Indeed, it has a long attachment with your files uuencoded! we are
D> almost home!

To reiterate: Still in Outlook Express, select the folder of interest,
and select find: Edit (E)>F>M, now search for everything, e.g., by
checking all items 'earlier' than 'now', now all items are added to
the found set, then select them all: Edit (E)>A.

Now pick Mail(M)>A to 'send them all as attachments' [devious or
what?!], now choose File (F)>A to save this letter with its many
attachments as a file. [Don't pick "save the attachments" (V) as that
will create a mess, especially with same Subject lines...]

Save this file as whatever.eml . [Inside this file one can see that the
messages are also uuencoded .eml files.]

D> OK, now boot up GNU/Linux and go to that file and run my brilliant
D> shell script below. when I did it my file with the long attachment
D> was called *.eml . "col" I think cured the ^M's at end of
D> lines. [try dos2unix next time]

: #middle part of Outlook 5 -> Outlook Express 5 -> gnus travail
set -ex
#my personal setup for this run
source=mysentmail.eml #file forced out of OE 5 by extreme methods
target=outlook_sent_mail #I plan to call a new gnus nnml folder
#or for another run of mine:
source=mymailbox.eml
target=outlook_inbox

maildir=~/Mail/mail/$target #gnus's'
grep -c begin\ 666 $source #informational and quit if error [0 found]] [set -e] above]
mkdir $maildir #fail if already there... we would be overwriting!
cat $source|col| (cd $maildir
awk '
BEGIN {xxx="uudecode"}
#uudecode only can handle one encapsulated file it seems
/begin 666/ {print "begin 666 "++a|xxx;next} #neaten names, else uses Subject...
{print|xxx}
/^end/ {close (xxx)}
'
chmod og-rw * #mail is private
)

D> this gives you $maildir/1 $maildir/2 $maildir/3 ... each file
D> containing one of your brilliant posts, which I'm sure now can be
D> handled by gnus in one of its many modes... I 'suppose' you needn't
D> neaten file names if you don't mind spaces in filenames and want to
D> see the subject as the filename... but what if there's a slash in
D> there or something... forget it and use 45 46 47... much cleaner.

More on our next episode. Anyway _maybe_ one would just $ cat * >
becomes_a_new_unix_mailbox_format_file [but add "Lines:" first, see
below] but I will see how gnus deals with the separate files on our
next episode.

ok, in this episode I had already behind the scenes put those files
where gnus wants them (see news:gnu.emacs.gnus to learn about gnus,
I'm not going to go into detail here, as I'm not too qualified.)
However, the ones from Outlook were missing the "Lines", as well as
were some of those from Outlook Express,

#now in shell,
#see which are lacking the ^Lines line

set -x
for i in ~/Mail/mail/*o*
do
cd $i
ls|wc -l
grep ^Lines: *|wc -l
done

of my 1 Outlook Express box and 2 Outlook boxes, I found
messages vs. "Lines:" header found
904 906 mail/my_oe_posts
850 5 mail/outlook_inbox
1336 906 outlook_sent_mail
Therefore I will add the Lines header of some messages with:

set -ex #-e because dangerous if mistype
# Add "Lines:" header lines to already extracted individual
# former outlook messages and strip DOS carriage returns too.
# Below I use dos2unix which just removes DOS carriage returns
# I found it on my Mandrake Contributions CD, 10Kbytes
# dos2unix-3.1-6mdk.i586.rpm

T=/tmp/addlines
F=~/Mail/mail/outlook_inbox
#F=~/Mail/mail/outlook_sent_mail
#F=~/Mail/mail/my_oe_posts
mkdir $T
cp -p $F/* $T #or do dir dir...
cd $T
set +e
for i in *
do
dos2unix $i #strip carriage returns
sed '/^$/q' $i|grep -q "^Lines:" && continue
set `sed -n '/^$/{=;q;}' $i` `wc -l $i`
body_lines=`expr $2 - $1 + 1`
ed $i <<EOF
$1i
Lines: $body_lines
.
w
q
EOF
done #ed did add newlines to the end of a few files, ok, i suppose

diff -b $F $T

#now cautiously move them back over the old ones, and do
# (nnml-generate-nov-databases-1 "~/Mail/mail/outlook_sent_mail/")
# (nnml-generate-nov-databases-1 "~/Mail/mail/outlook_inbox/")
# (nnml-generate-nov-databases-1 "~/Mail/mail/my_oe_posts/")
# inside gnus

Anyways, In gnus I now see
838: nnml:mail.outlook_inbox
902: nnml:mail.my_oe_posts
1324: nnml:mail.outlook_sent_mail
probably because I have
(setq gnus-secondary-select-methods '((nnml "")))
in .gnus.el . But I forgot. I haven't done the stuff in Info "File:
gnus, Node: To From Newsgroups" yet.

>>>>> "ZSH" == ShengHuo ZHU <z...@cs.rochester.edu> writes:

ZSH> "Osman" <tala...@get2net.dk> writes:
>>> Hi, I want to start using Gnus as my mail reader (i know it's
>>> really a news reader), but before i do the switch I have to,
>>> somehow, convert 2-3000 mails from my current mail reader which is
>>> Outlook Express 5.5 to something that Gnus understands, so I need
>>> a program which can do this. Does anyone here know of any such
>>> programs or have any experience with doing this ? Alternatively,
>>> if that is not possible, I can convert these messages to something
>>> else (ie. Netscape mail) and then do the conversion

ZSH> OGnus (since 2000-07-16) can read some formats of OE mailboxes as
ZSH> nndoc, i.e., you can type `G f' to subscribe an OE mailbox, then
ZSH> copy messages from the mailbox to another backend. But I am not
ZSH> sure whether it understands the format of OE 5.5 mailbox. If
ZSH> not, sending me a sample mailbox (at least two mails in it) will
ZSH> help me figure it out.

P.S. This advice copyright GNU/GPL, No warranty [duh.] Mom says backup first.
--
http://www.geocities.com/jidanni Tel886-4-25854780 e-mail:restore .com.

0 new messages