if count chunk = input('[press enter key]'pause after each chunk def showmessage(imsglist)if < <len(msglist)fulltext fetchmessage(imessage parser parsemessage(fulltextctypemaintext parser findmaintext(messageprint('- print(maintext rstrip('\ 'main text partnot entire mail print('- and not any attachments after elseprint('bad message number'def savemessage(imailfilemsglist)if < <len(msglist)fulltext fetchmessage(isavefile open(mailfile' 'encoding=mailconfig fetchencodingsavefile write('\nfulltext '-'* '\ 'elseprint('bad message number' def msgnum(command)tryreturn int(command split()[ ]exceptreturn - assume this is bad helptext ""available commandsi index display nlist all messages (or just message nd nmark all messages for deletion (or just message ns nsave all messages to file (or just message nm compose and send new mail message quit pymail display this help text ""def interact(msglistmsgsizesmailfile)showindex(msglistmsgsizestodelete [while truetrycommand input('[pymailaction(ildsmq?'except eoferrorcommand 'qif not commandcommand '*if command =' 'break quit elif command[ =' 'showindex(msglistmsgsizesindex the mailtools utility package