from email.parser import BytesFeedParser import email.policy def main(): eml_string = 'From: Nobody <""@example.org>' parser = BytesFeedParser(policy = email.policy.default) parser.feed(eml_string.encode()) msg = parser.close() print(msg.get('From').addresses[0].addr_spec) if __name__ == '__main__': main()