Increased visibility for sent file
We may want to add an explicit button for opening the sent-mails file. PyMailGUI
already does save sent messages to a text file automatically, which may be opened
currently with the list window’s Open button. Frankly, though, this feature may
be a too-well-kept secret—I forgot about it myself when I revisited the program
for this edition! It might also be useful to allow sent-mail saves to be disabled in
mailconfig for users who might never delete from this file (it can grow large fairly
quickly; see the earlier prompt-for-deletion suggestion as well).
Thread queue speed tuning
As mentioned when describing version 3.0 changes, the thread queue has been
sped up by as much as a factor of 10 in this version to quicken initial header down-
loads. This is achieved both by running more than one callback per timer event
and scheduling timer events to occur twice as often as before. Checking the queue
too often, however, might increase CPU utilization beyond acceptable levels on
some machines. On my Windows laptop, this overhead is negligible (the program’s
CPU utilization is 0% when idle), but you may want to tune this if it’s significant
on your platform.
See the list windows code for speed settings, and threadtools.py in Chapter 10 for
the base code. In general, increasing the number of callbacks per event and de-
creasing timer frequency will decrease CPU drain without sacrificing responsive-
ness. (And if I had a nickel for every time I said that...)
Mailing lists
We could add support for mailing lists, allowing users to associate multiple email
addresses with a saved list name. On sends to a list name, the mail would be sent
to all on the list (the To addresses passed to smtplib), but the email list could be
used for the email’s To header line. See Chapter 13’s SMTP coverage for mailing
list–related examples.
HTML main text views and edits
PyMailGUI is still oriented toward supporting only plain text for the main text of
a message, despite the fact that some mailers today are more HTML-biased in this
regard. This partly stems from the fact that PyMailGUI uses a simple tkinter Text
widget for main text composition. PyMailGUI can display such messages’ HTML
in a popped-up web browser, and it attempts to extract text from the HTML for
display per the next note, but it doesn’t come with its own HTML editor. Fully
supporting HTML for main message text will likely require a tkinter extension (or,
regrettably, a port to another GUI toolkit with working support for this feature).
HTML parser honing
On a related note, as described earlier, this version includes a simple-minded
HTML parser, applied to extract text from HTML main (or only) text parts when
they are displayed or quoted in replies and forwards. As also mentioned earlier,
this parser is nowhere near complete or robust; for production-level quality, this
would have to be improved by testing over a large set of HTML emails. Better yet,
1118 | Chapter 14: The PyMailGUI Client