Make the mail plugin work.

This was really disfunctional. Now it works just fine. I hope.