already metplus handful of new techniquesloads this client loads all email from the server into an in-memory python list only onceon startupyou must exit and restart to reload newly arrived email saves on demandpymail saves the raw text of selected message into local filewhose name you place in the mailconfig module of example - deletions we finally support on-request deletion of mail from the server herein pymailmails are selected for deletion by numberbut are still only physically removed from your server on exitand then only if you verify the operation by deleting only on exitwe avoid changing mail message numbers during session--under popdeleting mail not at the end of the list decrements the number assigned to all mails following the one deleted since mail is cached in memory by pymailfuture operations on the numbered messages in memory can be applied to the wrong mail if deletions were done immediately parsing and composing messages pymail now displays just the payload of message on listing commandsnot the entire raw textand the mail index listing only displays selected headers parsed out of each message python' email package is used to extract headers and content from messageas shown in the prior section similarlywe use email to compose message and ask for its string to ship as mail by nowi expect that you know enough to read this script for deeper lookso instead of saying more about its design herelet' jump into an interactive pymail session to see how it works running the pymail console client let' start up pymail to read and delete email at our mail server and send new messages pymail runs on any machine with python and socketsfetches mail from any email server with pop interface on which you have an accountand sends mail via the smtp server you've named in the mailconfig module we wrote earlier (example - here it is in action running on my windows laptop machineits operation is identical on other machines thanks to the portability of both python and its standard library #there will be more on pop message numbers when we study mailtools later in this interestinglythe list of message numbers to be deleted need not be sortedthey remain valid for the duration of the delete connectionso deletions earlier in the list don' change numbers of messages later in the list while you are still connected to the pop server we'll also see that some subtle issues may arise if mails in the server inbox are deleted without pymail' knowledge ( by your isp or another email client)although very raresuffice it to say for now that deletions in this script are not guaranteed to be accurate client-side scripting