Valeon

Start typing — titles, tags, and the full text of every post.

On a light lab-grid plate, three boxes on the left and two on the right are joined by two-headed arrows to one box in the centre, the only one outlined in amber.

Introducing convex-email: Email for Convex, Both Ways

SFSayed Hamid Fatimi
10 min read
Listen to this post0:00 / --:--

Ten days ago, in Two Hundred Bookmarks, I wrote about rules that had only lived in my head. Most of what has happened since is about email, which is a sentence I didn't expect to write with any enthusiasm. This post introduces convex-email, an open-source component for sending and receiving email in Convex apps. It also catches up on everything else that shipped across Valeon, VocaSync and Plutarc in the meantime.

Three Copies of the Same Letter

I started building email into my own products well before I ever wrote about it. Each of them needed to receive mail as well as send it, and when I went looking for something that would let a Convex app do both, everything I found sent. Nothing received. The posts came much later, once I'd spent long enough in that landscape to write about it for people who don't build software: receiving custom-domain mail for free with Cloudflare and sending it in April, then vemail in July, for anyone who wants a proper mailbox on their own domain without a big-name provider. convex-email is for the other side of that line: the transport underneath a product that sends and receives mail itself.

In the meantime, each product grew its own. Valeon needed mailboxes for authors, reserved addresses that forward to whoever should read them, and a newsletter, but no support tickets. VocaSync needed support tickets, routed by the address a reply comes back to, and no human mailbox. Plutarc needed mailboxes, reserved addresses and tickets. All three sent through Resend, using the official Convex component for it, and since that component only sends, receiving was built outside it. Three times, separately, each a little differently.

That is how drift happens. Plutarc's mailbox began as a copy of Valeon's. By the time I sat down to compare them properly, the function names still matched one for one and almost nothing else did. One copy had a fix that made messages readable in light mode, and the other didn't. One sent attachments, and the other quietly dropped them. I had started to forget which product was missing what, which is a strange thing to admit about software you wrote yourself, albeit with a lot of help.

The comparison also turned up three faults that every product shared. None of them gave its outgoing mail an ID of its own, so when someone replied, the reply couldn't be matched to the message it answered by its headers. Each had a second way of sending that skipped its own wrapper, and whatever the wrapper did, recording the message or honouring test mode, was lost on that path. None of them stopped mailing an address after it bounced. Three copies of the same letter, each with its own mistakes, and the mistakes they shared were the ones that mattered most.

There was one more problem, and it belonged to Resend. With several domains on one account, Resend sends every domain's events to every webhook registered on the account. Each product received the others' mail notifications and had to filter them out in its own code, which made a fourth place for the copies to disagree.

One Component, Both Ways

The obvious fix was to take the official component and add what was missing. I looked at that and turned it down. Its tables are shaped around Resend, it has no receiving and no suppression, and a fork of something maintained upstream drifts by definition, which was the very problem I was trying to solve. It also keeps its API key in plain text in its own table. So I built a new component, and it handles mail in both directions.

On the way in, convex-email fetches each message, parses it, records the SPF, DKIM and DMARC results that say whether the sender is who they claim to be, cleans the HTML on the server, keeps the attachments, and threads replies to the messages they answer. On the way out, every message gets an ID of its own, attachments and threading headers go out intact, and each message is tracked until it's delivered. An address that hard-bounces or complains is suppressed, and newsletters carry the one-click unsubscribe header that mail clients look for, with a hook so the app's own preferences follow when someone opts out. Test mode is on until you turn it off. The component never stores credentials: it asks the app for them each time it needs them. Several tenants can share one deployment if they need to, and an app with a single tenant never has to think about it.

What it leaves out was a deliberate choice. Mailboxes, reserved addresses, tickets and permissions are all about users, and a component can't see an app's users. The products also want different things from them, so a shared mailbox would have fitted none of them well. Each product keeps its own, built on top, and the documentation has guides for the common shapes: a support desk, replying by email, a team inbox per tenant, forwarding to a person, a newsletter, and a delivery audit trail. The one exception is forwarding a received message to a person with its attachments, which needs the component's internals to do safely, so the component does it. Everything beyond plain sending is optional. A product that never receives mail never sets receiving up, and can add it later without changing how it sends.

The component speaks to providers through adapters, and Resend and Amazon SES are there from the first release. SES because several of my products already live on AWS, and because an AWS account only ever sees its own events, which makes the shared-webhook problem disappear. With Resend, the adapter filters those events before they reach the app, and anything it never sent is set aside. One instance can hold both providers, and every message records which one carried it, so the provider that sends new mail is a single setting. Because it is the same component either side of a switch, threads, suppressions and unsubscribe links carry across. Receiving follows the domain's mail records, so it moves when the DNS does. In testing I sent through SES, switched back to Resend, and an address SES had suppressed stayed suppressed.

Testing against the real thing paid for itself on the first afternoon. The first genuine reply to a message sent through SES didn't thread. SES's own event had carried a shorter form of the message's ID and overwritten the correct one. That was fixed within the hour, and the next reply threaded as it should.

When I checked the Convex components directory this week, it looked much as it had when I first went looking. Most of the email components only send. One sends and receives, but only through its own service. I couldn't find one that receives mail across more than one provider. convex-email has been listed there since Friday, as "Email: Inbox + Outbox".

It went from first release to version 0.1.11 between Wednesday and Friday. Every public function is documented on the site, and tests check the documentation against the code so the two can't drift apart. There's a live demo you can send mail to and watch arrive, and the code is public.1 Like the rest of the family it carries a Valeon mark: an envelope whose flap is Valeon's V. VocaSync moved all of its email onto it on Thursday, and Plutarc the same day. valeon.blog gets it later.

Narration

The last post said that nothing already narrated gets read again. A change of voice still never re-narrates a post, but about fifty posts have been narrated again since, and the reason belongs here. Before Valeon sends a post to be narrated, it prepares a speech version of the text, and that step had been getting things wrong for longer than I'd like. Ordinals came out as "onest", "fiveth" and "twentyth". A figure with a scale word read as "nineteen dollar billion". Full stops left on lines of their own put odd pauses into lists. Correcting the text changes what the word highlighting follows, so the posts it touched were narrated again, and audio and highlighting now match. That is also why "Two Hundred Bookmarks" now carries an editor's note pointing here.

The other reason was names. VocaSync's narration model guesses how to say names it doesn't know, and guesses differently from one request to the next. In one early narration "VocaSync" came out as something closer to "Voi-co-vers". VocaSync now has a pronunciation library: you type a word the way you say it, Claude turns that into phonetic notation, you hear a short preview, and every narration on the account says it your way from then on. Valeon uses it, so "Valeon" and "VocaSync" are said properly in new narrations. A reviewer can now re-narrate a post even when its text hasn't changed, so older posts can pick up the library too.

A long post is narrated in parts and joined. The joins used to be uneven, sometimes rushed and sometimes abrupt. They're now measured pauses with a little room tone, so the narration doesn't drop into dead silence between sentences, and a heading is read with the section it introduces rather than announced on its own. Authors can choose a narration voice for a post or for all their posts, from the dashboard or from the Obsidian plugin. And for anyone listening, the player now has a speed control, from three-quarters speed up to double, in both the full player and the small one that follows you down the page.

VocaSync

Beyond the narration work, VocaSync took on the same identity as the rest of the family: a waveform mark drawn in the same frame as Valeon's, with "A Valeon project" beside it. It has an About page that tells how it started, and top-ups can now be any amount from £5 to £500 instead of a fixed set. Transcription changed underneath as well, and long recordings now hold their alignment at the points where they're split.

Plutarc

Plutarc was redesigned on Wednesday. The jade-teal theme became near-black ink with a single violet accent, keeping green and red for profit and loss, where they mean something. The old candlestick logo became a mark drawn in the same family as the others, and the site's header and footer now follow the same structure as Valeon's and VocaSync's. Plutarc also moved its email onto convex-email the next day.

Smaller Things

Author pages and book pages on Valeon are now full width. They work as landing pages for a publication more than as reading pages, and at desktop widths they had been wasting a good part of the screen. In the author dashboard, the posts list gained sorting, filters and search, and the home page summarises what needs attention instead of listing every item. The rich editor no longer forgets how a table's columns were aligned when it saves.

The development vault I wrote about last time can now be read as a private site of its own, behind a login, which makes it far easier to read on a phone between deliveries than the repository ever was.

When I started building email into these products, I assumed each one needed its own because each one wanted something different. That was half right. They wanted different mailboxes, and the mailboxes stay theirs. The part underneath, the sending and receiving and threading and bounces, was the same job done three different ways, and done worse each time for being done alone. It's one job now, done once, in public, where anyone running Convex can use it and anyone can check it.

Footnotes

Related posts

Twenty pale bars on a dark lab-grid plate rise from left to right, one per month from April 2025 to November 2026, counting Valeon's posts; the last and tallest bar, reaching 200, is the only one in amber.

Two Hundred Bookmarks

The 200th post. Valeon's rules, written down at last on one editorial standards page, footnotes on the blog, 45 new VocaSync voices reading the posts, and a dev vault that left Obsidian for plain git.

SFSayed Hamid Fatimi
12 min read
A futuristic block with glowing, golden neural connections and a digital control panel embedded within it.

The Gold is in the Structure

Valeon has been rebuilt from the ground up and VocaSync has matured significantly — same surfaces, different beasts underneath. A full account of what shipped, what changed architecturally, and what's coming next.

SFSayed Hamid Fatimi
7 min read
A person sits at a desk in a dimly lit room, working on dual computer screens with a colorful design, surrounded by art supplies and photography equipment.

Illness is an Audit

Recent challenges led to crucial behind-the-scenes upgrades at Valeon, resulting in improved resilience and transparency across our products, with powerful new features in gramatic, and a seamless integration with Canva to enhance content production workflows.

SFSayed Hamid Fatimi
5 min read