Hi, I just added a page to the wiki with a PHP CLI script I wrote to export mail from a 1.x account to maildir format. Mysql only.. it would be easy enough to modify for postgresql, or for 2.x servers.
It worked for me on a Red Hat EL3 server, but your mileage may vary.. Feel free to copy, change, improve (not hard probably) anyway you want. Be careful, it shouldn't blow up, but it could, as I intended it to be run as root. That means it could really hose things up. I think it could run as the postmaster account, or whomever should own the maildir files, but you'd have to mod it. Anyhow, I'm rambling. Enjoy. -Micah