the class defined in example - does the work of interfacing with pop email server--loadingdeletingand synchronizing this class merits few additional words of explanation general usage this module deals strictly in email textparsing email after it has been fetched is delegated to different module in the package moreoverthis module doesn' cache already loaded informationclients must add their own mail-retention tools if desired clients must also provide password input methods or pass one inif they cannot use the console input subclass here ( guis and web-based programsthe loading and deleting tasks use the standard library poplib module in ways we saw earlier in this but notice that there are interfaces for fetching just message header text with the top action in pop if the mail server supports it this can save substantial time if clients need to fetch only basic details for an email index in additionthe header and full-text fetchers are equipped to load just mails newer than particular number (useful once an initial load is run)and to restrict fetches to fixed-sized set of the mostly recently arrived emails (useful for large inboxes with slow internet access or serversthis module also supports the notion of progress indicators--for methods that perform multiple downloads or deletionscallers may pass in function that will be called as each mail is processed this function will receive the current and total step numbers it' left up to the caller to render this in guiconsoleor other user interface unicode decoding for full mail text on fetches additionallythis module is where we apply the session-wide message bytes unicode decoding policy required for parsingas discussed earlier in this this decoding uses an encoding name user setting in the mailconfig modulefollowed by heuristics because this decoding is performed immediately when mail is fetchedall clients of this package can assume message text is str unicode strings--including any later parsingdisplayor save operations in addition to the mailconfig settingwe also apply few guesses with common encoding typesthough it' not impossible that this may lead to problems if mails decoded by guessing cannot be written to mail save fails using the mailconfig setting as describedthis session-wide approach to encodings is not idealbut it can be adjusted per client session and reflects the current limitations of email in python --its parser requires already decoded unicode stringsbut fetches return bytes if this decoding failsas last resort we attempt to decode headers onlyas either ascii (or other common formattext or the platform defaultand insert an error message in the email body-- heuristic that attempts to avoid killing clients with exceptions if possible (see the mailtools utility package