list if len(command= for in range( len(msglist)+ )showmessage(imsglistelseshowmessage(msgnum(command)msglistelif command[ =' 'save if len(command= for in range( len(msglist)+ )savemessage(imailfilemsglistelsesavemessage(msgnum(command)mailfilemsglistelif command[ =' 'mark for deletion later if len(command= needs list()iter todelete list(range( len(msglist)+ )elsedelnum msgnum(commandif ( <delnum <len(msglist)and (delnum not in todelete)todelete append(delnumelseprint('bad message number'elif command[ =' 'send new mail via smtp trysendmessage(exceptprint('error mail not sent'elif command[ ='?'print(helptextelseprint('what-type "?for commands help'return todelete def main()global parsersenderfetcher mailserver mailconfig popservername mailuser mailconfig popusername mailfile mailconfig savemailfile parser sender fetcher mailtools mailparser(mailtools mailsender(mailtools mailfetcherconsole(mailservermailuserdef progress(imax)print( 'of'maxhdrslistmsgsizesignore fetcher downloadallheaders(progressmsglist [parser parseheaders(hdrtextfor hdrtext in hdrslistprint('[pymail email client]'todelete interact(msglistmsgsizesmailfile client-side scripting