pymailcgiyou should not delete mails with it in an important accountunless you employ one of the solution schemes described or you use other tools to save mails to be deleted before deletion adding state retention to ensure general inbox synchronization may make an interesting exercisebut would also add more code than we have space for hereespecially if generalized for multiple simultaneous site users utility modules this section presents the source code of the utility modules imported and used by the page scripts shown earlier as installedall of these modules live in the same directory as the cgi scriptsto make imports simple--they are found in the current working directory there aren' any new screenshots to see here because these are utilitiesnot cgi scripts moreoverthese modules aren' all that useful to study in isolation and are included here primarily to be referenced as you go through the cgi scriptscode listed previously see earlier in this for additional details not repeated here external components and configuration when running pymailcgi out of its own directory in the book examples distribution treeit relies on number of external modules that are potentially located elsewhere because all of these are accessible from the pp package rootthey can be imported with dotted-path names as usualrelative to the root in case this setup ever changesthoughthe module in example - encapsulates the location of all external dependenciesif they ever movethis is the only file that must be changed example - pp \internet\web\pymailcgi\cgi-bin\externs py ""isolate all imports of modules that live outside of the pymailcgi directoryso that their location must only be changed here if movedwe reuse the mailconfig settings that were used for pymailgui in ch pp /' container must be on sys path to use the last import here""import sys #sys path insert( ' :\users\mark\stuff\books\ \pp \dev\examples'sys path insert( 'relative to script dir import mailconfig from pp internet email import mailtools local version mailtools package this module simply preimports all external names needed by pymailcgi into its own namespace see for more on the mailtools package modulessource code imported and reused hereas for pymailguimuch of the magic behind pymailcgi is actually implemented in mailtools the pymailcgi server