initial commit of mailtool.py

it's not tested, don't use this