MailCatch is my first website in Lua. Its purpose is to allow any incomming emails on any accoutns to be available for a while. That is, it is a temporary email address system, or virtual inbox. It all started one year and a half ago when I got pissed off while trying to install a mail server for my newly aquired server(which now hosts NetCore and my services). I tried postfix, qmail, sendmail and more but each time I stumbled upon some annoying road blocks (like not being able to use mysql for virtual users). So being the Lua geek I am I decided to make my own smtp server (Tethys) instead of trying to work around the bloated config files other the “big ones”.
My goal was simple: fulfill my specific needs, which were at the time:
- maildir support
- virtual users using a mysql database for definition
- subdomains support
- easy configuration
- easily extensible by plugins
- probably some more I forgot now
After reading the SMTP RFCs, I set out to find some nice Lua packages (LOOP OO programing lib, LuaSocket, …), made a few on my own (Telestos) and started having great fun! After a few days I had a basic implementation going and go onto the plugins part.
Then an idea hit me in the head (yes it hurts a bit), as I wanted to be able to make new virtual addresses easily to handle spam sent to me I thought “but why define addresses ? Just let them all in on a subdomain!”, and so the basic idea for MailCatch was born (which was totaly a non-new idea for the rest of the world it seems as therer are otehr such services, but I was not aware of them by then).
The MailCatch plugin for Tethys was started, it was to be simple and pretty fast. I did not want to burn my hard drive by writing spam to it, there is no use, usualy mail spam addresses are one time use only, so I made the plugin a delivery plugin. That means when Tethys has finished receiving a mail it passes it to a delivery plugin to do something with it, the default one writes it to a maildir spool, but this one just keeps it in memory for a little while and then forgets about it. No hard drive access!
Once I was satisfied I made a quick website in Lua (which I’ll explain in an other post) to display the mails in the plugin memory. This site later became MailCatch (which you all know .. obviously!) when I decided other people might find a use for it.