1

I'm in the process of migrating my Mbox format emails to the Maildir format. To this end I use mb2md which works great.

Nevertheless I've just come to realize that sometimes in my Mbox folders a blank line does not appear right before the "From " lines as it should, leading mb2md to not detect what follows as being a new email.

That's why out of a Mbox folder of 64 emails I end up with a Maildir of 32 emails...

I'm trying to use pcregrep to spot those cases but have a hard time figuring out the right regexp for detecting: a non-empty line followed by "From ".

Any idea?

Rene
  • 43
  • 4

1 Answers1

2

Seems like it would just be:

pcregrep -Mn '.\nFrom ' myfile

You could also pre-process the bogus mbox with formail -es which would add the missing lines.

Stéphane Chazelas
  • 522,931
  • 91
  • 1,010
  • 1,501