Added code originally in POP3Client repo