Added the code of the mail sink.