Make sure you have the procmail
package installed, and then run the following:
$ for i in MAILDIR/cur/*; do formail -I "Status: RO" < "$i" >> MBOX; done
I work as a freelancer, so if you don’t want to do that kind of things yourself or don’t have the time, just drop me a line to hire me.