(dovecot must be installed)

1. Install libraries

2. add the following code in to: configure.php5 (custombuild/configure/ap2/)

3. Build

source: http://www.directadmin.com/forum/showthread.php?t=29156