Merge imapc from archaelus/erlmail.