The IMAP server shipping with RedHat 6.1 and latest RAWHIDE has horrible performence issues. Upgrading to IMAP 4.7 I have seen a single message query go from 40 seconds, to 2 seconds. My mail agent is TWIG 2.0.3 (web client, providing mail servies) being feed by RedHat 6.1 posgresql/php.