The Smell of Molten Projects in the Morning

Ed Nisley's Blog: Shop notes, electronics, firmware, machinery, 3D printing, laser cuttery, and curiosities. Contents: 100% human thinking, 0% AI slop.

Kmail: Copying Directory Structures and Some Files Therein

As part of the Kmail blank email problem, I conjured up a new, shrunken maildir structure with just the most recent 30 days of email. However, I want to keep all the same folders, even if they have no current email messages, so my filters can sort the incoming mail properly.

The sequence of events:

  • shut down Kmail!
  • move existing email directory out of the way
  • set up a new directory
  • copy the directory structure
  • copy the most recent 30 days of email
  • delete the existing index files

That’s straightforward, at least after you figure it out. Took me a while to get it right, but here ya go…

cd to the directory holding the Mail folder
mv Mail Mail.base
mkdir Mail
cd Mail.base
find . -type d -print0 | cpio --null -dmpv ../Mail
find . -type f -mtime -30 -print0 | cpio --null -apdv ../Mail
cd ../Mail
find . -type f -name ".*index" -print0 | xargs -0 rm
find . -type f -name ".*index.ids" -print0 | xargs -0 rm

Then fire up Kmail and let it rebuild all the index files.

You ought to try that out on a dummy version of your email, as something may have gotten clobbered in the transition from my terminal to your fingertips, OK?

Comments

3 responses to “Kmail: Copying Directory Structures and Some Files Therein”

  1. Werner Avatar
    Werner

    Have the same problem. Your fix didn’t work for me, still have the following behaviour:

    If I do a index rebuild. All E-Mails appear but when I klick finally the OK button of the folder properties dialog all disappears again.

    1. Ed Avatar

      As it turns out, it doesn’t work for me, either. Just now I got another blank email; if past experience is any guide, many more are on the way.

      It’s time to kick Kmail to the curb, which means I can also unload all that bizarre Akonadi and Nepomuck crap, too. If they’d feature-freeze KDE and spend the next year fixing another quarter-million bugs, maybe they’d have something worthwhile.

      Even as I type, I’m in the midst of switching to Evolution (which seems to be the best of a bad lot), which means I must convert all my emails from maildir to mbox. More on this as I figure it out…

  2. Kmail: FAIL « The Smell of Molten Projects in the Morning Avatar

    […] Ed @ 07:52 Tags: Rants, Improvements In the unlikely event you’re keeping track of this, slashing the total volume of email made Kmail much more competent: it hadn’t trashed an index file in, oh, […]