Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Fix mbox dates prior to importing into Mail.app Apps
Apple's Mail program won't import an mbox file (such as one exported from another mail program) if the date is not in a valid format. It will actually import the entire mbox file as one email message, without a warning. Apparently, many mail programs don't use the right date format, even though the format is clearly spelled out in the mbox spec.

I found a Perl script online that converts the date to the correct format. (It's probably a good idea to run this on a copy of your mbox file in case it doesn't work.)

#! /usr/bin/perl -ni.bak

use Date::Parse ;
use Date::Format ;
$template = "%a %b %d %R:%S %Y" ;

if (/(^From )([^        ]*) (.*)/) {
    $time = str2time($3) ;
    $date = time2str($template, $time) ;
    print "$1$2  $date\n" ;
} else {
    print ;
} ;
[robg adds: I haven't tested this one...]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[3,885 views]  

Fix mbox dates prior to importing into Mail.app | 2 comments | Create New Account
Click here to return to the 'Fix mbox dates prior to importing into Mail.app' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Fix mbox dates prior to importing into Mail.app
Authored by: scottboms on Mar 09, '04 01:24:52PM

This seem to require a Perl module to be installed to actually do the date conversion. Since I know very little about Perl, how would I go about installing the module? It's complaining about missing Date/Parse.pm in @INC (etc).

Also, while we're at it, does anyone know if this works with mbox files from Entourage v.X? There was an earlier hint about importing mbox files into Mail.app, but I couldn't get ones from Entourage v.X to import or even be available for importing. I'm working if this might be part of the fix to get that working.



[ Reply to This | # ]
Fix mbox dates prior to importing into Mail.app
Authored by: SuperCheese on Mar 14, '04 03:27:45PM
Sorry for the late reply. You could install Perl using Fink. Or try CPAN for help on installing Perl modules. It will take some effort unfortunately.

[ Reply to This | # ]