will lead us to full-blown email clients and websites in later two design notes worth mentioning up frontfirstnone of the code in this package knows anything about the user interface it will be used in (consoleguiwebor otheror does anything about things like threadsit is just toolkit as we'll seeits clients are responsible for deciding how it will be deployed by focusing on just email processing herewe simplify the codeas well as the programs that will use it secondeach of the main modules in this package illustrate unicode issues that confront python codeespecially when using the python email packagethe sender must address encodings for the main message textattachment input filessaved-mail output filesand message headers the fetcher must resolve full mail text encodings when new mails are fetched the parser must deal with encodings in text part payloads of parsed messagesas well as those in message headers in additionthe sender must provide workarounds for the binary parts generation and text part creation issues in email described earlier in this since these highlight unicode factors in generaland might not be solved as broadly as they might be due to limitations of the current python email packagei'll elaborate on each of these choices along the way the next few sections list mailtools source code togetherits files consist of roughly , lines of codeincluding whitespace and comments we won' cover all of this package' code in depth--study its listings for more detailsand see its self-test module for usage example alsofor more context and exampleswatch for the three clients that will use this package--the modified pymail py following this listingthe pymailgui client in and the pymailcgi server in by sharing and reusing this moduleall three systems inherit all its utilityas well as any future enhancements initialization file the module in example - implements the initialization logic of the mailtools packageas usualits code is run automatically the first time script imports through the package' directory notice how this file collects the contents of all the nested modules into the directory' namespace with from statements--because mailtools began life as single py filethis provides backward compatibility for existing clients we also must use package-relative import syntax here (from module)because python no longer includes the package' own directory on the module import search path (only the package' container is on the pathsince this is the root moduleglobal comments appear here as well the mailtools utility package