Sunday, September 25, 2005

Repair Courier IMAP maildir

A handy little script to repair maildirs.

I stupidly deleted all empty folders in users' homes, realizing too late that it would delete some of the essential new, cur and tmp directories in the maildirs. After that, folders could not be opened anymore. Outlook would say "STATUS failed", and Thunderbird reported "Unable to open this mailbox".

This little script recreated the missing directories:

#!/bin/sh

for M in /home/*/Maildir ; do
echo checking $M
for d in cur new tmp ; do
[ -d "$M/$d" ] || { echo "* Creating $M/$d"; mkdir "$M/$d"; }
chown -c --reference "$M" "$M/$d"
chmod -c 700 "$M/$d"
done
find $M -type f -name maildirfolder | while read ; do
f=`dirname "$REPLY"`
echo " checking $f"
for d in cur new tmp ; do
[ -d "$f/$d" ] || { echo " * Creating $f/$d"; mkdir "$f/$d"; }
chown -c --reference "$f" "$f/$d"
chmod -c 700 "$f/$d"
done
done
done

Friday, September 09, 2005

A quote to remember

I wish this quote would be taught in school:
"Of course the people don't want war. But after all, it's the leaders of the country who determine the policy, and it's always a simple matter to drag the people along whether it's a democracy, a fascist dictatorship, or a parliament, or a communist dictatorship. Voice or no voice, the people can always be brought to the bidding of the leaders. That is easy. All you have to do is tell them they are being attacked, and denounce the pacifists for lack of patriotism, and exposing the country to greater danger."

-- Herman Goering at the Nuremberg trials

But I'm also afraid those who would need to remember it later would not. Those who do, know and abuse this fact already. But still, maybe a few journalists could remember it and remind their readers occasionally. The occasions do come up quite regularly.

Urban Legends Reference Pages: Questionable Quotes (Hermann Goering)