This is a regression introduced by r295200 in the 1.4 branch, among others. However, only 1.4.39.1-r1 in portage is affected (currently being the only ebuild to support IMAP at all). Reported and resolved upstream so I'm effectively filing this as a TODO item for the next revision.
Created attachment 262367 [details, diff] r306963 from the 1.4 branch
Asterisk 1.4 is being removed from the portage tree; please use 1.6.2 instead.