Dovecot 2.0.x before 2.0.16, when ssl or starttls is enabled and hostname is used to define the proxy destination, does not verify that the server hostname matches a domain name in the subject's Common Name (CN) of the X.509 certificate, which allows man-in-the-middle attackers to spoof SSL servers via a valid certificate for a different hostname.
https://bugzilla.redhat.com/show_bug.cgi?id=754980
https://bugs.gentoo.org/show_bug.cgi?id=390887
http://www.openwall.com/lists/oss-security/2011/11/18/7
http://www.openwall.com/lists/oss-security/2011/11/18/5
http://www.dovecot.org/list/dovecot-news/2011-November/000200.html
http://secunia.com/advisories/52311
http://secunia.com/advisories/46886