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


Click here to return to the 'A script to import messages into Mail from KMail, etc.' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to import messages into Mail from KMail, etc.
Authored by: antheo on Jun 21, '06 07:23:57PM

The script works great it converted my email in maildir format in mbox format but when i try to import them in Mail.app. Mail recognizes the files as mbox but refuses to import them. It does not do anything neither it creates the folders nor it displays an error.

How could i change the script or set up Mail to import the maildir emails?



[ Reply to This | # ]
A script to import messages into Mail from KMail, etc.
Authored by: yksrais on Nov 04, '06 05:22:00PM
The same for me, so I had a look on the code and fix two things: 1. From: -> From Error 2. the original script ignore the date, the E-Mail was sent, just create for all mails the same date Here my working version:
#!/bin/bash

mdirname='cur'

find . -name $mdirname | while read from; do
nm=`dirname $from | sed 's/[^a-zA-Z0-9]/-/g; s/^-*//; s/--*/-/' `
echo "Converting $from into $nm"
/bin/ls -1 "$from" | while read message; do
echo -n `cat $from/$message | grep '^From:' | head -n1 | sed 's/.*]*)>.*/From 1/' | sed 's/^From:/From /'; cat $from/$message | grep -m 1 '^Date:' | sed 's/,//g' | awk '{print $2" "$4" "$3" "$6" "$5 }'`
echo
cat $from/$message | sed 's/^From /From:/'
done > $nm.mbox
done
(C) 2006 linux2macSwitcher

[ Reply to This | # ]