Recently I had to cancel an Internet connection for a family member. The ISP informed me that once cancelled we would understandably no longer be able to access email or cloud services associated with the account.
I wanted to back up the email account on the off chance there was something important contained within but at the same time I did not want sift through each and every email. Nor did I want to read someones potentially personal email unless I absolutely had to.
My initial thoughts were to simply download an email client like Thunderbird and synchronise that on a computer. I could not really be bothered to do this.
A quick search led me to this answer on Stack Exchange.
I used offlineimap and did successfully backup the files. The files were exported in the Maildir format (with which I am not familiar), and whilst they can be opened in a text editor, the backup was not easily usable without using a mail client.
The answer in question suggests using a console based email client called mutt to read the backed up files. I had a brief play without success.
I was not particularly interested in investing a lot of time into this. All I wanted to do was a quick, easily usable backup on the off chance that I were to need it in the future. Fortunately I then stumbled upon NoPriv, an open source python script which backs up your email over IMAP and generates the appropriate HTML files such that you essentially have a local email inbox.
It is simple (read the source code), and well documented. Open source is great.