NMail is Neat

I’ve written a lot of longer blog posts lately, time to get back into the classic “Nate talks about the thing he just read about and finds neat.” So, without further ado, I just read about NMail (github) - and I think it’s neat. In fact, I think it’s actually one of the most interesting decentralized communication tools I’ve seen in a while.

Email is still king

Email is still the king of communication - according to Wikipedia, 50 million non-spam emails are sent every day. Whether it’s a contact feature for a blog, the need to send a (small) file, or helping setup a church website - email is usually my go to because of its ubiquity. Unlike something like messengers, which vary a lot between different communities, nationalities, and interests; you’ll have a hard time finding somebody without an email address. Even if it’s becoming a little less popular in my generation (gen z) and lower - probably because companies like to spam like no tomorrow, and I doubt most people use filters on their inbox - it’s still universal across all age groups as well. Not to mention it’s, unlike most messengers or social media platforms, an open protocol where you can feasibly own1 your own identifier and server2.

There’s also something a bit refreshing about email as well. The longer letter style format - with subjects, rich text, and good attachment support - make for nicer communication than a quick text/IM message. Longer messages with formatting can be nice, and as you can probably tell from my writing, I tend to be a bit verbose. And, with its more letter style usage, emails feel easier to operate with on your own time. Responding to an email 20 hours after it was received because you only check email once a day feels natural. Responding to a text/IM message 20 hours later feels a lot more iffy, and in our always online world, slowing down a bit can be refreshing.

What was I talking about again? Right, NMail.

Honestly, at first glance, the project looks a little boring. It’s email like messages, but over the decentralized Nostr protocol. Neat in concept, but not exactly ground breaking. Not to mention the good old standards conundrum, except in this case, there’s probably like 12 people who’ve used NostrMail - all just to toy around with it. It’s an experimental standard with few users, built on top of an experimental protocol with few users - impossible to actually grow a userbase. Except, that’s not actually true. Under the hood, NMail messages are actually bone stock3 RFC 2822 emails. A completely normal email is whipped up - the kind that could be imported into an Outlook or Thunderbird folder - then encrypted using end-to-end encryption and delivered over a decentralized protocol. It’s not exactly re-inventing the wheel, it’s just upgrading the powertrain that spins those wheels.

Okay, cool, but I still can’t email my friends … except I actually can. The biggest thing that caught my eye was the bridge, a.k.a. a standard email server. While the client doesn’t need a server to operate (again, we’re on a decentralized network by default), you can configure a bridge in the client. If you send an NMail to another user on the NMail using an NPUB (Nostr Key Identifier): a standard email is generated, it’s E2E encrypted, then delivered via relays. If, however, you send to a standard email address: the same standard email is generated, then delivered via the bridge to arrive in a normal email inbox. Sort of like Proton/Tuta - sending to another user of that platform gives a truly E2E message that stays within that ecosystem, while letting you communicate with everyone else using a standard email.

That’s the promising part, and what makes me think that NMail might have a chance at growing. Bridges and backwards compatibility are always the “have your cake and eat it too” solution. You get all the benefits of the better encryption and decentralized delivery when you’re communicating with someone who has it, but you get to communicate with anyone on regular email with the same pros & cons of regular email. That paradigm makes me think it’s actually got a decent chance of being useful, and apparently I’m not the only one who thinks that, because the dev behind it just got an OpenSats grant last week.

Setup & Anti Spam

I made a quick draft of this post on April 15th, and in it mentioned that at some point somebody is probably going to use the bridge for spam and get it blocked. But, as of today (23rd) it looks like there’s already been an anti spam feature implemented - which is great for the project, though makes it a touch more complicated to setup. I have a feeling that development is going to be quick and any guide I write is going to be out of date really fast, but if you wanted to give it a try, here’s how:

First, go to app.nostrmail.org. If you’re one of the 12 existing Nostr users, you can sign in with an nsec bunker or extension, but if you’re not, you can click sign up. Read through the informational slideshow, set your name, and copy your ‘sync code’ (an nsec, a private key that controls your account). Now click “Go to your inbox” and you’re already pretty much set. You can click your profile and click copy npub, which is your public address - think of it like GPG: your nsec is your private key for you to safeguard, and your npub is your public key to share with others. You can now send decentralized messages4. If you want to test it out, my account is npub1jy90jpcdl447ae3lp4924s65khdpvnttkg7fepmvmafycusyueksrvllx9 - if you send me a message I’ll probably reply a few days later with a subpar meme or something.

Enabling the bridge
Setting up the bridge to send emails to standard addresses is a bit more complicated. First, go to nostr-mail.web.app and sign in (choose “nsec” then paste your sync code/nsec into it if you’re just toying around and registered using one). There are currently two account tiers: “blocked” and “free” (looks like a paid tier is coming, but not yet implemented). If you’re a regular Nostr user and already have a WOT Score, then you’ll already be in the free tier; otherwise you’ll likely be ‘blocked.’ If you are in the blocked tier, you’ll need at least one credit to get moved into the free tier, which can be done by ‘mining’ or paying for a credit.

‘Mining’ for credits, which I’d recommend you do, is going to have your device do some math equations to prove it’s not a bot (similar to Cloudflare or Anubis anti-DDoS tools). It took my phone less than 3 seconds to ‘mine’ a credit, and once you’ve generated one, you’re automatically moved from ‘blocked’ to ‘free.’ You can also send 0.008$ USD worth of Bitcoin for a credit, but I feel like it’s pointless; not only would it probably take longer to send crypto - assuming you even have crypto - but it’s such a laughably small amount that it’s not even like you’re making a real donation to support the project.

Once you’re in the free tier, you can use the bridge to send 10 emails per day and receive 100, with any ones beyond that limit using credits (this limit only applies to using the bridge to send/receive standard emails - Nostr based emails to/from public keys are decentralized and unlimited). You can now go back to your inbox, click “settings,” then “hosting” in settings. Scroll down to the bridges section and click the plus icon next to the “uid.ovh” bridge (the default bridge hosted by the dev) and save your settings.

Sending regular emails via the bridge
With the bridge enabled, you can now send mail to regular emails as well. If you want to receive regular emails, your email should be [npub]@uid.ohv such as npub1jy90jpcdl447ae3lp4924s65khdpvnttkg7fepmvmafycusyueksrvllx9@uid.ohv (my nmail address via the bridge). Though I’m assuming there’ll be the ability to use a custom name at some point, especially on self hosted bridges. To send an email to a standard address, choose “Compose” and click on the “^” button to expand your options. Click on your username in the “From” section and change it from your npub to the bridged address ending in @uid.ohv. Now, instead of sending an email to an npub, you can instead type in a regular user@domain as the intended recipient.

final_ramblings

So yeah, I think it’s neat. Now, of course, it’s in early development, so don’t expect to change your mail server out quite yet. The web client is working, although the native clients are still being worked on. The bridge is also a bit minimal, only allowing key@bridge-domain addresses instead of custom usernames (not to mention, though I haven’t tried self hosting the bridge, I assume that’d have a hint of jank in it as well). But still, it’s working, decentralized, end-to-end encrypted email when staying within the network - that has standard compatibility with normal emails. As I said above, it’s probably the most interesting project I’ve seen in a while from the decentralized communication space, and I think its focus on compatibility might give it a decent shot at succeeding. I’ll certainly be keeping an eye on it.

Footnotes:


  1. Or, at least rent. You can’t truly ‘own’ a domain or IP address, and unless it’s a server you have in your closet, you don’t really ‘own’ your VPS. But, compared to everything else, having a domain and server is close-ish to ‘owning.’ ↩︎

  2. Even in open source/open standards, not a lot of forms of communication are so open. Something like SMS is an open standard, but you can’t host your own. Messengers like Signal or WhatsApp have open source protocols, and you can set up your own servers, but you can’t communicate with Signal or WhatsApp users on them. The truly open options are a lot smaller - think messengers like Matrix/SimpleX/Marmot or social media protocols with DM features like Activity Pub/Nostr - but those all have very small userbases. ↩︎

  3. Well, at least mostly bone stock. RFC 2822 is actually a bit out of date, the latest email standard is RFC 5322. According to my research (i.e. I asked an AI and experimented with it a bit), that shouldn’t matter too much - emails under the old standard are still backwards compatible with modern clients and mail servers. The biggest risk (again, according to AI) is that it might be more likely to trip a spam filter. I’m unsure of the reason as to why the older standard was chosen. ↩︎

  4. You can also send a decentralized message to NIP-05 usernames, a domain based name (such as [email protected]) that links to a public key. But, if you’re just testing it out, going through the trouble of setting up a NIP-05 domain username is probably going to be more of a hassle than just sending an email to an npub (public key hash). ↩︎