Ooops, I got distracted from #moggie work, by other moggie work!
I rewrote moggie's microservice pattern for another project... but the rewrite was so much better than moggie's, that I've been gagging to backport my changes. I finally bit the bullet in Jan. But if two projects are using the same code... then that's actually 3 projects.
So, I present Kettlingar - Pythonic RPC Kittens! https://github.com/mailpile/kettlingar
I'll have to toot a bit about why this is neat. And maybe write a talk... meow!
So #moggie sent an e-mail last night! A few in fact. It's a milestone!
Still need to work quite a bit on the API around sending, in particular authentication and debugging.
But progress is being made...
... in the terminal. That detail got lost in my excited tooting. The #moggie UI that renders HTML so nicely is a text-only terminal app.
I'm really pleased with how #moggie renders HTML e-mails to text!
I spent some time making links (and embedded images) "clickable" - it pops up a dialog that lets me either open the browser or copy the URL to the clipboard.
I know there are still people who believe that text/plain is the One True Way - but on today's Internet, if you aren't reading the HTML you just aren't getting the message much of the time.
The ship sailed. HTML is part of e-mail.
I had a wild idea (for #moggie) in the shower the other day.
Moggie has a nice Python-based filter system, which can be easily [ab]used to extend moggie to do arbitrary Pythonic things with incoming e-mails.
One of the big tasks I have left, is working on configurability - answering questions like "what is the default e-mail address when composing in this context?"
The wild idea: What if I make the configurability logic pluggable, like the filters are?
This is very exciting.
I've been reading mail in #moggie, which I used to just ignore. Because it's nice!
"Hmm, what IS this mail delivery failure? If it is garbage, can I filter it out of my mailbox?"
This then leads to further improvements to DSN handling, some parsing bugfixes, improvements to the text UI so I can better examine the contents of the error messages, and maybe some fixes to the keyword generation and filters.
This is how dogfooding is supposed to work!
One of the #python issues I struggled with in #moggie, at least until recently, was code crashing (in asyncio tasks) without logging any useful stack traces.
Maddening!
Eventually I found the culprit: https://github.com/mailpile/moggie/commit/77562834880d5b979bb2078eaa9d6f3974d614ab
Turns out it had nothing to do with asyncio: returning a non-None value from an __exit__() method will swallow all exceptions.
A feature, not a bug... confusing!
Spending some moments today pushing up my accumulated #moggie changes to Github, and verifying that the instructions in the README still mostly work.
Nothing stands still, so recent distros and Pythons have broken some of my older assumptions. Nothing too serious so far, thankfully!
Interestingly, the aiosmtplib seems to have been removed from more recent Ubuntus. I wonder why? I'm juuust about to do SMTP work, should I use something else?
Now working: #moggie annotate
Annotate is a command for attaching arbitrary key-value pairs to e-mail metadata.
This is used in the DSN handling I posted about recently, to record which message the error pertains to.
The reason I am working on annotations, is I need it for the e-mail sending subsystem. Moggie needs to record progress, successes and errors - to facilitate retries and such things.
I try to solve things like that by adding generic capabilities: there will be other use-cases.
A fun thing I did while developing this, is I wrote as much of the logic as I could as a custom filter rule, enhancing the filter environment until it had enough information/context for the rule to detect and process DSNs.
Now that I have a filter rule that works, I will of course move that to #moggie 's main source code ... but the improvements to the filter subsystem will remain.
Because rather than ship some custom filter language with moggie, moggie's mail filtering language is just (...)
One of the things #Mailpile never did well, was processing bounces and other delivery status notifications (DSNs).
I am currently being side-tracked from what I was working on (sending mail), to add the features #moggie needs to do better.
As a start, I just want to recognize the DSN as part of the thread, the error is a reply to the message. Once the two are linked in this way, I can iterate on how they are presented in the UI.
Mutt doesn't appear to do even this much. Do other mail clients?
Watching #moggie copy e-mails out of my old encrypted #Mailpile storage, into a shiny new Maildir-in-a-ZIP is really very satisfying.
It would be nice if it were faster, but in practice this will be such a rare operation that it's probably not worth optimizing. At least not yet!
If I create a relatively simple command that replicates the tags from #Mailpile into a new #moggie setup, then my migration toolchain will be complete!
Been getting data from my #Moggie cat health tracker for the past few days. It's like a cat Fitbit...
Insights: the kitties sleep a lot, jump a lot, and barely spend time walking.
Yep, they're cats.
At least it'll help me establish a baseline to notice if anything is wrong. Cats are known to be very secretive about being sick or injured.
Here's mommy cat showing her tracker off.
I've reached the point now where #moggie is my daily driver for *reading* e-mail. It's quicker and more reliable than my old Mailpile installation.
I'm also using #moggie to download and archive my mail, using moggie's native Maildir-in-a-ZIP mailbox format.
This all feels pretty great! Finding and fixing so many little buglets in the process... nothing beats using the software.
The next big milestone will be composing and sending mail. Can't wait!
Oh great, #moggie is corrupting files in my home directory!
Turns out the zipfile module I am using, when opening files with mode='a', will append a ZIP table of contents, even if the file is not a ZIP archive. Instead of (or in addition to?) throwing an error. This may have been my fault.
Fixed it! Best push that, in case someone is foolish enough to test my code.
This week I've found and fixed a BUNCH of little (and big) buglets in #moggie
Including one that had me worried that I had a subtle data corruption issue... Turns out I just had a decoding issue! Thankfully, no innocent bits were harmed in the making of this bug.
It's almost as if taking a break helped me see things that were invisible to me before...
I worked on #moggie again a bit today! I've been on a break due to a baby and other life things.
Felt good to dip my toe back in.
Had my first seriously delayed London Tube trip this morning.
Spent about 45 minutes barely due to a signal failure. Was late to work as a result, for the first time. Not the only one, I'm sure!
Silver lining: That was a good chunk of #moggie hacking time!
When my coworker asked if the delay had annoyed me, I couldn't really say yes...
#Moggie deleted some e-mails today. It's a milestone, I am pleased.