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