Add mail stuff from old code