I am looking for a pure elisp email program to examine and potentially modify.
The following Emacs mailers are written entirely in Emacs Lisp:
The following Emacs mailers are mostly written in Lisp, but use some components written in C:
All of them, as far as I am aware. I use Gnus myself. You can see the IMAP protocol parsing in nnimap.el, POP3 in pop3.el, etc.