ftp://ftp.cac.washington.edu/imap/imap-2007f.tar.gz
tar zxvf imap-2007f.tar.gz
cd imap-2007f
make bsf SSLTYPE=unix EXTRACFLAGS=-fPIC
cd /usr/local/src/php-5.3.27/ext/imap
/usr/local/php-5.3.27/bin/phpize
./configure --with-php-config=/usr/local/php-5.3.27/bin/php-config --with-imap=/usr/local/src/imap-2007f --with-imap-ssl
make && make install