Hi all, Here's what I've been up to. Quoting from docs/imap/DESIGN:
The world is now mobile-first, and many of us are mobile-only, or nearly so. When my smart phone took over my life, two things happened to my nmh usage: - At work, I was frustrated constantly by messages read under nmh being unread on my phone and vice versa. - In my personal life, that same frustration drove me away from nmh completely. Whenever I need to reply to email from my computer, I find my self incorporating months of messages. We can use IMAP to make nmh a first-class citizen in the modern mail world. * Goals - Treat the IMAP server as the source of truth. - Minimize startup penalty to nmh commands. - Minimize the impact to the nmh code-base. - Minimize round-trips to the server. - Enhance =inc= to incorporate mail from a hierarchy of IMAP mailboxes. - Enhance =inc= to delete mail locally that has been deleted on the server. - Enhance all commands interpreting the user's =Unseen-Sequence= (i.e. all those taking message specifications (=mh-sequence(5)=), e.g. =mark=, =pick=, =scan=, =show=) to interpret references to the =Unseen-Sequence= as all messages not flagged as =\Seen= on the server. - Enhance =scan= output to reflect live =\Seen= status when it is asked to display whether messages appear in the user's =Unseen-Sequence=. - Enhance =show= to set the =\Seen= flag on messages shown. - Enhance =mark= to set or clear the =\Seen= flag for messages removed from or added to the user's =Unseen-Sequence=, respectively. - Enhance =rmm= to delete messages from the server. - Enhance =refile= to move messages on the server. - Enhance =comp= and =repl= to allow usage of a server-side draft folder. ** Language I've programmed in C and C++ for most of my career and I've just about had it with unsafe languages. The thought of implementing IMAP synchronization in C discouraged me from even starting for years. In my last position at Google, my fellow tech lead and I would often joke about dividing the team in two, with one team continuing to chase down a memory corruption error we'd failed for months to find, and the other rewriting the system in Rust. It was a joke, but the idea stuck with me. Since Rust allows transparent calls into C, we can seamlessly embed Rust into nmh programs. Why not give it a shot? I know it wasn't all that long ago I proposed using Perl from the test suite and that was rejected for the perfectly valid reason that we want the test suite to keep working without Perl. So how can I show up and propose Rust, which is not even supported on many of our supported platforms? Well, unlike Perl in the test suite, this is fully optional and fully self-contained. Users without access to Rust can use use mh just the same way they could for the last 4 decades. I am already using this as my daily driver, but a lot of work remains before I'd be comfortable proposing merging this to master, and taking the "experimental" tag off it is even farther out. I have plenty of things to do here in the short term (testing and handling so many edge and error cases, cleaning up the big mess I've made in sbr are top of the list), but if others have any ideas or suggestions, I'd be happy to hear them. I'll be working on the branch in public now; no more big code drops. Also, if anyone wants to try it out but has trouble getting it working, let me know. It's quite rough around the edges now. Aside from daily usage on FreeBSD, I periodically test it on Oracle Linux. Here's what I have in .mh_profile: Managed-Folders: g gmail #: [email protected] at Gandi g-manager: /home/epg/work/nmh/.o/clang13/target/debug/imap-folder-manager g-db: /home/epg/Mail/.epggandi.db g-socket: /home/epg/Mail/.epggandi.db/socket g-log-trace-to: /home/epg/Mail/.epggandi.db/log g-log-level: debug g-max-fetch-messages-in-flight: 100 g-host: mail.gandi.net g-port: imaps g-tls: implicit g-auth: SASL g-user: [email protected] #: GMail IMAP gmail-manager: /home/epg/work/nmh/.o/clang13/target/debug/imap-folder-manager gmail-db: /home/epg/Mail/.gmail.db gmail-socket: /home/epg/Mail/.gmail.db/socket gmail-log-trace-to: /home/epg/Mail/.gmail.db/log gmail-log-level: debug gmail-max-fetch-messages-in-flight: 100 gmail-host: imap.gmail.com gmail-port: imaps gmail-tls: implicit gmail-auth: SASL gmail-saslmech: xoauth2 gmail-user: [email protected] gmail-authservice: gmail gmail-mailbox-root: [Gmail]/ gmail-mailbox-exclude: . gmail-mailbox-include: All Mail Thanks, and happy hacking!
