reference implementation of imail client