Python simple multithreaded tcp server and pop-server emulator as example