msgid [line for line in split if line[: lower(='message-id:'if (msgid or msgid and (msgid !msgid )self trace('different message-id'return false try full hdr parse and common headers if msgid missing or trash tryheaders ('from''to''subject''date'tryheaders +('cc''return-path''received'msg mailparser(parseheaders(hdrtext msg mailparser(parseheaders(hdrtext for hdr in tryheadersposs multiple received if msg get_all(hdr!msg get_all(hdr)case insensdflt none self trace('diff common headers'return false all common hdrs match and don' have diff message-id self trace('same common headers'return true def getpassword(self)""get pop password if not yet known not required until go to server from client-side file or subclass method ""if not self poppasswordtrylocalfile open(mailconfig poppasswdfileself poppassword localfile readline()[:- self trace('local file passwordrepr(self poppassword)exceptself poppassword self askpoppassword(def askpoppassword(self)assert false'subclass must define method###############################################################################specialized subclasses ###############################################################################class mailfetcherconsole(mailfetcher)def askpoppassword(self)import getpass prompt 'password for % on % ?(self popuserself popserverreturn getpass getpass(promptclass silentmailfetcher(silentmailtoolmailfetcher)pass replaces trace the mailtools utility package