Convert Vpopmail to Postfix + MySQL

At work we're in the middle of moving from qmail + Vpopmail setup to Postfix, mainly because qmail-remote is unable to move bounces & redirects to bogus (generated) or invalid e-mail addresses to deferred chain, or even to the bottom of remote queue. Instead qmail-remote just keeps trying to send the messages, so remote mail queue fills up, and eventually all messages in top of queue are pointed to bogus addresses. This of course chokes up the remote mail delivery completely.

Ok, so we need to convert Vpopmail user account and alias information to be used with MySQL and Postfix.
Well here's a small script that i wrote for doing the job, hope someone finds it useful:

http://fclose.org/files/vpopmail_to_pf_mysql.py

At the moment you'll have to run it separately for each vpopmail subdir (eg. ~/domains/0, ~/domains/1 and so on). Also, it stores passwords as cleartext, because we're using courier-imap which currently doesn't support hashes when used with Postfix, sucks but we'll have to deal with it.

The script basically creates two files, which include SQL inserts for Postfix+MySQL (and if i recall, postfixadmin) setup.