refactoring: use tox and introduce unittest
move get_domain_from_email() in EmailTools
load lxml
use a file per source
add a .gitignore file
flake8
avoid a stat()

target_image + '.temp' should be here BTW.
the script is a bit cleaner now
drop an useless “else”
do not mix internal and external lock system
Pillow instead of PIL for imaging
various minor bugs