rikard.me/blog/019.txt Sun 24 Nov, 2024 A month with Notmuch Last month I wrote about my struggles with M-x rmail. While I do love Rmail, it just wasn't working for me anymore. Rather than staying with it and being miserable, I decided to try some other Emacs email clients. My first idea was to use mu4e. It's one of those clients that I've heard people talk about for ages, but that I've never had the need or interest to look into. Email clients in Emacs delegate the heavy lifting (fetching, indexing and sending email) to external software, Emacs is only used for reading and writing email. mu4e is no different. mu4e is an elisp package that provides a front-end with which you read and organise your mail; it relies on the 'mu' indexer, for -- well -- indexing. I liked the idea of mu4e, but the moment I saw that dnf wanted to pull in a bunch of Qt dependencies for mu I quickly realised I wasn't interested. Second in line was Notmuch, and after testing it I've actually been using it daily for a month now. The main issue I had with Rmail was that it relied on the mbox format, which just didn't work well with my workflow. Notmuch lets you fetch and send however you want; the only restriction it puts on you is the format that you save your email in, and this format is mdir. Converting my existing mbox files to the mdir format was surprisingly easy with the mb2md program. Converting my 'archive.mbox' file, which contained a few thousand emails, took about a second. Notmuch is a command line utility. To index email in your mail directory, you run 'notmuch new' from the command line. This searches for new email in the directory and, if it finds any, indexes it. I still use Movemail to fetch email from my mail provider, and I've got this baked into a daemon that fetches email automatically every 30 minutes. Notmuch has hooks, which lets you run arbitrary executables in conjunction with the notmuch command. This lets me replicate the 'rmail-get-new-mail' command, as I can bake my Movemail script into the 'notmuch new' command. Really cool stuff! The process of actually indexing email is so fast, I can't describe how nice it feels. During my initial setup I had a few thousand emails to index. The whole process took, I think, less than a second. (Compare this to Rmail which needed 20-30 seconds to sort email -- which is different from indexing, sure, but it made the overall program feel slow and old.) The only real annoyance I have with Notmuch is that it doesn't allow me to delete email. The developers behind Notmuch seem to pride themselves on the fact that they don't alter or touch your email, they just index them for you. That's fine I guess, but deletion is such a basic function that I would expect any email client to have. The workaround for this is to use tags, which is a big feature of Notmuch. I can tag an email with 'deleted', and then tell the client to never display emails with this tag. I really am not a fan of 'out of sight, out of mind', but it works I guess. I never used tags in Rmail, but I've ended up using them in Notmuch, mainly because it lets me sort email into the typical folders that I have. New email automatically gets tagged with 'inbox' and 'unread'. Email that I've read and want to keep gets tagged with 'archived'. Email that has an action associated with it but that I don't want to or should handle right here and now gets tagged with 'actionable'. When I run Notmuch I get a nice list of tags with a number next to them indicating how many emails have the respective tag. Really nice stuff, it's something I missed in Rmail. Writing and sending email is no different from Rmail, we still use 'message-mode' and 'smtp-mail' in Notmuch. Overall I'm really happy with Notmuch and I have a feeling I'll be sticking with this for a long time. With that said, I am going to miss Rmail.