This a very simple conversion but since I might need the command again:
for file in `find ~/path/to/maildir/{cur,new}/ -type f` do cat $file | formail >> mbox done