php_imap.c in PHP 5.2.5, 5.2.6, 4.x, and other versions, uses obsolete API calls that allow context-dependent attackers to cause a denial of service (crash) and possibly execute arbitrary code via a long IMAP request, which triggers an "rfc822.c legacy routine buffer overflow" error message, related to the rfc822_write_address function.
https://www.redhat.com/archives/fedora-package-announce/2009-May/msg01465.html
https://www.redhat.com/archives/fedora-package-announce/2009-May/msg01451.html
https://exchange.xforce.ibmcloud.com/vulnerabilities/43357
https://bugs.gentoo.org/show_bug.cgi?id=221969
http://www.vupen.com/english/advisories/2009/1297
http://www.us-cert.gov/cas/techalerts/TA09-133A.html
http://www.ubuntu.com/usn/usn-628-1
http://www.securityfocus.com/bid/29829
http://www.securityfocus.com/archive/1/501376/100/0/threaded
http://www.openwall.com/lists/oss-security/2008/06/24/2
http://www.openwall.com/lists/oss-security/2008/06/19/6
http://www.mandriva.com/security/advisories?name=MDVSA-2008:128
http://www.mandriva.com/security/advisories?name=MDVSA-2008:127
http://www.mandriva.com/security/advisories?name=MDVSA-2008:126
http://support.apple.com/kb/HT3549
http://security.gentoo.org/glsa/glsa-200811-05.xml
http://secunia.com/advisories/35650
http://secunia.com/advisories/35306
http://secunia.com/advisories/35074
http://secunia.com/advisories/32746
http://secunia.com/advisories/31200
http://marc.info/?l=bugtraq&m=125631037611762&w=2
http://marc.info/?l=bugtraq&m=124654546101607&w=2
http://lists.opensuse.org/opensuse-security-announce/2008-12/msg00002.html
http://lists.apple.com/archives/security-announce/2009/May/msg00002.html