Clean mail module source code

Solve the #114 issue.