Changed dependency on mail to be a bit more flexible