files may be processed pop message numbers and synchronization by nowwe've seen all the basic functionality of pymailgui--enough to get you started sending and receiving simple but typical text-based messages in the rest of this demowe're going to turn our attention to some of the deeper concepts in this systemincluding inbox synchronizationhtml mailsinternationalizationand multiple account configuration since the first of these is related to the preceding section' tour of mail deletionslet' begin here though they might seem simple from an end-user perspectiveit turns out that deletions are complicated by pop' message-numbering scheme we learned about the potential for synchronization errors between the server' inbox and the fetched email list in when studying the mailtools package pymailgui uses (near example - in briefpop assigns each message relative sequential numberstarting from oneand these numbers are passed to the server to fetch and delete messages the server' inbox is normally locked while connection is held so that series of deletions can be run as an atomic operationno other inbox changes occur until the connection is closed howevermessage number changes also have some implications for the gui itself it' never an issue if new mail arrives while we're displaying the result of prior download-the new mail is assigned higher numbersbeyond what is displayed on the client but if we delete message in the middle of mailbox after the index has been loaded from the mail serverthe numbers of all messages after the one deleted change (they are decremented by oneas resultsome message numbers might no longer be valid if deletions are made while viewing previously loaded email to work around thispymailgui adjusts all the displayed numbers after delete by simply removing the entries for deleted mails from its index list and mail cache howeverthis adjustment is not enough to keep the gui in sync with the server' inbox if the inbox is modified at position other than after the endby deletions in another email client (even in another pymailgui session)or by deletions performed by the mail server itself ( messages determined to be undeliverable and automatically removed from the inboxsuch modifications outside pymailgui' scope are uncommonbut not impossible to handle these casespymailgui uses the safe deletion and synchronization tests in mailtools that module uses mail header matching to detect mail list and server inbox synchronization errors for instanceif another email client has deleted message prior to the one to be deleted by pymailguimailtools catches the problem and cancels the deletionand an error pop up like the one in figure - is displayed pymailgui demo