(in server-side templating tools such as PSP the effect is similar, but Python code is
embedded in HTML code instead and run to produce values).
Since this is a script, we can also use the commonhtml page header and footer routines to
render the generated reply page with a common look-and-feel, as shown in Figure 16-7.
Figure 16-7. PyMailCGI view password login page
At this page, the user is expected to enter the password for the POP email account of
the user and server displayed. Notice that the actual password isn’t displayed; the input
field’s HTML specifies type=password, which works just like a normal text field, but
shows typed input as stars. (See also the pymail program in Chapter 13 for doing this
at a console and PyMailGUI in Chapter 14 for doing this in a tkinter GUI.)
The Mail Selection List Page
After you fill out the last page’s password field and press its Submit button, the pass-
word is shipped off to the script shown in Example 16-7.
Example 16-7. PP4E\Internet\Web\PyMailCgi\cgi-bin\onViewPswdSubmit.py
#!/usr/bin/python
"""
################################################################################
On submit in POP password input window: make mail list view page;
in 2.0+ we only fetch mail headers here, and fetch 1 full message later upon
request; we still fetch all headers each time the index page is made: caching
Messages would require a server-side(?) database and session key, or other;
3.0: decode headers for list display, though printer and browser must handle;
################################################################################
Reading POP Email| 1251