r/ryelang • • Oct 24 '26

Another practical example: Download all emails from IMAP to MBOX file

Post image

It seems I am on a practical Rye run lately. More practical examples of Rye can't hurt.

Yesterday I needed to find some documentation I send to a customer a few years back. I knew the keywords and even the related filename but my paid email provider, which is otherwise great ... well, their webmail search functionality really sucks. There is no chance of finding a little more complex query, a combination of words.

After I wasted half an hour trying to find it I decided to see if I can download all emails and search them locally, for example by something made in Rye and bleve full text search. Or just pop it into SQLite with FTS. But it seems I have to ask support and wait a few days for that (and pay per GB) for them to prepare it.

So I spinned up Rye and did this script with it and it's downloading emails right now ...

One thing I noticed. When I went writing a practical Rye script a few years back (I am working on Rye since ~2018), I spent more time fixing and improving Rye problems that got exposed by the script, than the script itself. These recent times, I basically just write Rye code.

Still, new release is coming this weekend: https://github.com/refaktor/rye/

This code will be in examples/imap/imap-backup/

Stars on Rye github stopped incrementing in last two months, I'm not sure ... if it's the people moving away from github, or nobody is programming any more anyway 🤔

7 Upvotes

0 comments sorted by