Here's a script I use to quickly recompile dovecot with vpopmail support on Debian 6.0. I'm using the backports repository to get the 2.1 version of dovecot.
Now I'm using the following script every time I update and I get a new version of the dovecot packages.
#!/bin/bash BDIR=./dovecot.$(date +%Y-%m-%d_%H-%M-%S) mkdir $BDIR cd $BDIR sudo apt-get source dovecot-core sudo apt-get build-dep dovecot-core dpkg-source -x *.dsc cd $(find ./ -type d |grep dovecot|head -1) sed -r -e 's/with-sqlite \\/with-sqlite \\\n\t\t--with-vpopmail \\/' debian/rules > debian/rules.mod cat debian/rules.mod > debian/rules DEB_BUILD_OPTIONS="--with-vpopmail" fakeroot debian/rules binary find $BDIR -type f -name "*.deb"|grep -v 'dbg' |xargs dpkg -i
The last line also installs all the dovecot packages except for the debug one. You might want to change it if you don't want all.