Email authentication

More in #201 (I messed up with the squashing so here it is)