(normally) - in two flavors. Used only to prioritize high-traffic pages for dev work, iff JS and tracker enabled. The former/defunct training site's id: ga('create', 'UA-52578333-1', 'auto'). The book site's id, now used for all: ga('create', 'UA-52579036-1', 'auto'). JS is also used if enabled for thumbspage galleries, Top buttons, TOCs, etc. Jun-2019: tell Google Analytics to anonymize IP address on receipt for privacy. More: https://developers.google.com/analytics/devguides/collection/analyticsjs/. Oct-2022: install a GA4 tag (i.e., script) alongside the prior UA tag. UA tags will stop collecting data in 2023. It's okay to use both until the cutover (and Google advises doing so), but the UA tag will be pointless after that and should be removed. This handles genhtml-insert clients; others get tags by running insert-analytics.py in package-publishing scripts. Also per Google: "In Google Analytics 4, IP anonymization is not necessary since IP addresses are not logged or stored". Let's hope so... -->
This is imapfetch, a Python script that both demos the IMAP email interfaces in Python, and provides a utility you can use to download your email with this interface so you can process it with the PyMailGUI program. The net effect is a work-around for email providers that have denigrated POP email in recent years; PyMailGUI doesn't do IMAP, but it can still be used to process email fetched that way.
This short Python 3.X command-line program fetches all messages from all (or selected) email folders at an email account host, using the IMAP interface. POP provides access to the inbox only; IMAP is more complex and not universally supported, but also gives access to all other saved-mail folders at the host (e.g., sent mails, drafts, etc.).
Mails fetched from the server are saved in one local file per folder, but not removed from the server. The saved-mail files created by this script on your computer are designed to be viewed and processed offline with the PyMailGUI program, which also illustrates POP and SMTP email processing, and swaps IMAP folders for local saved-mail files. For more on using PyMailGUI to process email files saved by imapfetch, click here.
Code and docs:
Examples:
Use the following to fetch imapfetch, or view its unzipped content.
This program was last changed: December 2015.
Recent upgrades: though not a change in the imapfetch script itself, the companion program used to view imapfetch saved-mail files changed substantially in 2017—PyMailGUI's display now looks like this and this on Mac OS X, and similar elsewhere. See PyMailGUI's home page for more details; some of the screenshots above are from its prior release, but work the same.
For more code examples, see the programs page.