This python programmers problem stumped me for a time. Then I acquired an inspiration: I'd let fetchmailconf work with fetchmail's own parser! I added a --configdump choice to fetchmail that would parse. Fetchmailrc and dump the results to standard output inside format of any Python initializer. For the file above, the result would look roughly such as Listing 2 (to avoid wasting space, some data not based on the example is usually omitted).