• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

Ever Heard of cc:Mail?

l008com

Well-known member
I changed from using gmail to using a quick mail server i set up on my server in the same room. Boy it uploads 2853 emails a lot faster now, but the result is the same.

Everything looks totally normal and correct on outlook on Windows. But that same IMAP account on Apple Mail is a mess with these winmail.dat attatchments. 

 

IPalindromeI

Well-known member
The cc:Mail importer dates back before HTML email, and RTF was the only way to do formatting. Of course, you had to put in in plain text; and make RTF optional, most people's mail clients couldn't do RTF. This is what you had to do as a compromise.

 

l008com

Well-known member
Ok I have managed to get the mail into an Apple Mail mbox without the winmail.dat stuff by importing through Thunderbird first. Don't worry, I'm taking notes and will post the whole thing when I'm done.

Everything looks really good, there is just one last problem. There's lots of quotes and escaped quotes around the To: and From: fields in the emails. For example:

"\"John; Smith\"<user@example.com>"

"John Smith <user@example.com>"

"John Smith <user@example.com>","Jim Smith <user2@example.com>","Joe Smith <user3@example.com>"

Things like that. Easy enough to edit and clean up in TextWrangler, but any thought on how to automate this process? Whilst only removing quotes and escaped quotes from headers, not bodys? And sadly it's basically plain text. The text of the header, a return or two, then the body, which may also contain a return or two. Honestly I'm not sure how a computer can even know whats header and whats body looking at an mbox file. But regardless, if there's a way to clean it up, that would be great!

Edit:

Perhaps a better way to show the example is thus: 

From "\"John; Smith\"<user@example.com>"
From: "John Smith <user@example.com>"

Sender: "John Smith <user@example.com>"

To: "John Smith <user@example.com>","Jim Smith <user2@example.com>","Joe Smith <user3@example.com>"

I guess that could make it easier to strip quotes with regular expressions, since I only want to do lines that begin with "From: " or "To: " etc. And TextWrangler can do grep find & replaces. Anyone good with regular expressions? 

 
Last edited by a moderator:

nglevin

Well-known member
fwiw I've had better luck with some versions of Adobe's much longer lived PSPrinter driver for printing out documents; it just translates to PostScript, which seems to be less problematic than dealing with ancient versions of PDF in the modern day.

Adobe still has it on their FTP site, version 8.5.1 for System 7.1 or later; ftp://ftp.adobe.com/pub/adobe/printerdrivers/mac/8.x/ps851.sit.hqx

Documentation at ftp://ftp.adobe.com/pub/adobe/printerdrivers/mac/8.x/ps851.txt

I actually tried "printing" out old documentation that was in Apple DocViewer format this way. Third party PDF printers didn't work well, and Adobe's official PDF Writer for 68k Macs was buggier than PSPrinter.

 

l008com

Well-known member
Summary of full conversion process:

You will need the original ancient machine running ccMail, a modern WIndows machine (or VM) and a modern Mac. 

Step One:

I suggest copying the drive of the machine with the mail data, so you can work off a copy in case things go wrong. And they will. Also you can't do this with just the raw data files, unless that raw data file is already a ccMail "Archive" file. It won't work with the regular ccMail mail storage data files.

Within ccMail, you need to create a new "Archive", which is a special kind of mailbox that is readable by other apps. Then you must copy all of the email into this archive. Once you're done, add ".cca" to the name of the file. This will make it easier to work with once you copy it to Windows.

Step Two:

Copy the ccMail file to a Windows machine.

Use the Microsoft Importer for Lotus ccMail Archives tool in Windows to convert the archive file into a .pst file, which is a microsoft outlook data file. Open outlook and the imported mail should be in there. I had lots of headaches here with Outlook not liking the file, and the importer not willing to create a new file from scratch. It occurred to me at this point that Windows functions in a very difference way than either old or new Mac OS. There's little logic involved in the way things work but just keep poking around if the apps are fighting you and it should work.

Step Three:

Getting the mail out of Windows Outlook is tricky. If you export out of there and import into Mac Outlook, you lose all of the To/From data from all of the email.

If you upload the mail to an IMAP account from Windows Outlook, you get every message encoded into a "winmail.dat" file.

Even though you'd think .pst is very common, the converter program Emailchemy does not seem able to read a .pst file.

So what you have to do is use Windows Thunderbird version 31 (Outlook import is broken in newer versions of Thunderbird, Mac Thunderbird doesn't support importing Outlook files) and import all of your outlook mail into thunderbird.

From Thunderbird, then you can upload all of the email to an IMAP server and you won't get the winmail.dat junk. Now you can access that IMAP account from any other program/platform, which for me is Apple Mail on modern macOS. But wait, there's more....

Step Four:

So one thing you'll notice is that there are lot of quotes and escaped quotes around the names and addresses on the emails, which prevents mail programs from seeing these names and addresses as proper email objects.

There's one more process to go through to fix this:

If you drag the imported mailbox out of Apple Mail (Drag the whole folder from the mailbox list) on to your desktop, you'll get an .mbox file. Except it's not a file, it's a folder. Open it up and you'll see a "mbox" file. We need to edit this file to clean up all these quotes. The process I do this by will probably drive many people crazy but I'm ok with that.

So first open the "mbox" file in TextWrangler or some equally capable code like text editor.

You need to do an unusual find & replace to re-join wrapped email header lines back into single lines again.

Replace this:

,[space][newline][space]"
 With this:

 Now we can run this "mbox" file through the PHP shell script (below), which will remove all of the funny characters from the To, From, Sender and Cc header lines. It creates a new mbox file that you import back into Apple Mail and....

BAM you are done.

6 months of work right here, though most of that time was me waiting for a new power supply so I could power up the PowerBook 520 again.

Can't embed the code properly, so you can view the php shell script I made on pastebin: php mbox header cleaner

 
Last edited by a moderator:

l008com

Well-known member
The

Code:
 bbcode tag seems to be broken, which is a bummer because my previous posts relies on it pretty heavily. 
 

l008com

Well-known member
Also I can't edit the original post, so can any moderators edit that first post of this thread and put a link directly to post #84 above? And if you do, can you then delete *this* post entirely.

 

NJRoadfan

Well-known member
It should be noted that Outlook 2000 (and only that version!) likely could have imported the .cca file directly too.

As for getting the stuff out of Outlook, this tool appears to be able to extract messages to the .eml (MIME) standard which just about any e-mail client supports: http://mfcmapi.codeplex.com/

You have to save the stuff to a MSG file in Outlook and then use the above to convert to EML.

This tool appears to be an Outlook plug-in that directly exports to EML: http://www.outlookfreeware.com/en/products/all/OutlookMessagesExportEML/

 
Top