Install packages php-mail-mimedecode and php5-imap.