
The Architecture of Mailinator (2007) - setra
http://mailinator.blogspot.com/2007/01/architecture-of-mailinator.html
======
zinxq
Surprised to see this here now after 11 years.

Needless to say, this is incredibly out of date. Mailinator now runs across
several servers with a real-time websocket system tied to Redis channels for
incoming emails. The multiple server system is more for fault-tolerance than
scaling issues.

The Websocket-to-redis connection allows incoming emails to be available the
instant they arrive (fully) at Mailinator. Instantly - no polling front-end or
otherwise. Public email storage is still in-memory with a system that chunks
emails into common parts and reuses them. A reference counting garbage
collector cleans them up once no email in the system is still using that part.
I tried compression a million different ways but nothing beat reusing parts of
emails.

[http://mailinator.blogspot.com/2012/02/how-mailinator-
compre...](http://mailinator.blogspot.com/2012/02/how-mailinator-compresses-
email-by-90.html)

The 2007 article is a valid picture of things then, but the system has come a
long, long way since that time.

~~~
flashmob
Hi! I run a "copycat" site that perhaps you may be referring to in that post,
GuerrillaMail.com (well, actually, I didn't copy it myself, but acquired it
from another guy many years back) and also been using Redis to store all
incoming mail in memory. RAM is cheap these days and you can find decently
priced servers with >= 128GB easy. Haven't moved over to websockets or
"chunking" / deduplication yet, but architecture and UI needs an update in
that direction to make it more instant. Thanks for some ideas ;-)

Actually, like you, I've also hand-rolled most of it myself, replacing the
previous guy's architecture. It's been a lot of fun. No frameworks, no
bootstrap, just a few dependencies here and there. Started with PHP, but now
prefer to use Go for anything new. Also hand-rolled the SMTP server which
turned in to a project on its own, [https://github.com/flashmob/go-
guerrilla](https://github.com/flashmob/go-guerrilla)

~~~
Dagger2
Is guerrillamail.com supposed to be displaying just a "Welcome to nginx" page?

Screenshot on the left:
[https://nat64check.ipv6-lab.net/v6score/measurement-30830/](https://nat64check.ipv6-lab.net/v6score/measurement-30830/)

------
willvarfar
Some related previous discussion
[https://news.ycombinator.com/item?id=3617074](https://news.ycombinator.com/item?id=3617074)
2012

And a blog post by me in reply to those comments, which is how I remembered it
:)
[https://williamedwardscoder.tumblr.com/post/18065079081/cogs...](https://williamedwardscoder.tumblr.com/post/18065079081/cogs-
bad)

~~~
swah
Even though Paul says that the service now runs on multiple nodes, I think the
general idea of your post is even more important than 10 years ago.

(I miss blogs..)

------
efiecho
Very useful service that I have used for many years. However, in the updated
version of Mailinator I can't find the "Alternate Inbox Name" anymore. Do
anyone know why this function was removed?

~~~
detaro
It still shows alternate domains for me on the front page, or am I
misunderstanding what you are looking for?

~~~
efiecho
Previously, if you created the inbox e.g. joe@mailinator.com an "Alternate
Inbox" name would be generated e.g. M8R-yrtvm01@mailinator.com. You could hand
out this address and the mail would still end up at joe@mailinator.com. This
would make the inbox a little more private.

~~~
rando444
A relatively unique name coupled with an alternate domain seems like it would
solve roughly the same problem, no?

------
privateSFacct
Before I used mailinator I was using the + addressing feature at google. I
just did username+site@ . The thing I found (at least back a fairly long time
ago) - a lot of folks you don't even think DO in fact sell your emails or get
bought and sell your email, or maybe it's their order processing or shopping
cart software. I couldn't fully figure it out.

It seems to matter a lot less now. I assume my email is out there, but google
does a remarkable job filtering my inbox (paying customer if that makes a
difference). And I've added DMARC / SPF / DKIM as well to my outbounds (went
from thousands of forged outbound to basically none so presumably spammers are
also watching some of these signals for whatever reason).

I always loved how fast mailinator was, and once I had that for all those
random quick orders I used it. Now I've just started using amazon for just
about everything - so less of a need for the mailinator emails.

~~~
svdr
If you use DMARC, your domain is less interesting for spammers, because lots
of providers will now bounce the emails they send using your domain.

------
sorokod
The AgingHashmap is basically a rate limiting device. Nowadays, Guava provides
something like this "out of the box".

Oh, and thanks for Mailinator.

------
CapacitorSet
I must say I'm surprised a Java application could handle 2.5M emails/day
(29/second) in less than 1 GB of RAM.

~~~
brianwawok
Why?

Would it surprise you to learn that many of the worlds financial markets run
on a handful of Java servers? Message rates of thousands of messages per
server is not uncommon.

Java is very fast. Very weird people in 2018 think it is not.

~~~
tonyarkles
I think one of the reasons people are startled by the RAM usage figures here
is that a Spring Boot app with a bunch of extra jars/"starters" added to it
idles at ~500-600MB without any load at all. And can take 30-60 seconds from
"java -jar..." to being able to successfully handle its first inbound HTTP
request.

~~~
brianwawok
Well, idle memory usage is not a super useful metric to measure for an app
that uses a GC. And in fact the comment was about speed... speed and memory
usage can often have inverse relations (think caches)

Startup time is not super useful when using a framework with 200,000 lines of
code. Try creating a webserver using Java + a servlet, you will be serving
requests in < .5 seconds on a modern machine...

~~~
tonyarkles
Oh, don't get me wrong, I totally agree. You can definitely create lean & mean
stuff in Java, it just doesn't seem to generally be the Culture of Java.

And while idle memory usage isn't an amazing metric, it's still pretty
indicative of bloat. For us, in the current state of things, memory usage is
what determines our cloud costs. Setting heap maximums and things seems to
somewhat work, although the Spring apps with a max heap set to 512MB still
seem to be able to overrun their cgroup max memory of 1GB. There's the new
experimental options to have the JVM look at its cgroup limits and manage
memory based on that, but due to reasons we don't have a new enough JVM yet.

For me and my tastes, Go's pretty tough to beat in the overall
productivity/efficiency/reliability set of tradeoffs. I fully admit that
that's a taste thing. It's not even that it's amazing at any particular thing,
it's actually not really that amazing at all. It just doesn't have anything
that particularly annoys me. And the community is awesome: they really don't
do the 200kloc framework stuff; the attitude is generally "why do you need all
that?" and I agree.

------
bluedino
Is there a container/vm out there that's ready to serve up a private
Mailinator-type instance that you can just point a domain to?

~~~
0x6877
I'm working on something similar but it's still a work in progress. And it's
not quite point a domain to it and your done type setup just yet. It takes
advantage of mailgun and uses webhooks rather than hosting an email server
yourself.
[https://github.com/haydenwoodhead/burner.kiwi](https://github.com/haydenwoodhead/burner.kiwi)

------
heinrichf
(2007)

~~~
sctb
Thanks, updated!

