C-client is a common API for accessing mailboxes. It is used internally by the popular PINE mail reader, the University of Washington's IMAP server and PHP.