Hacker News new | ask | show | jobs
by vidarh 4130 days ago
Qmail may show its age, but the overall structure is sound, and one the beautiful parts of qmail was/is how it isolated everything in their own processes intercommunicating via very simple protocols over file descriptors. So you could build far more complicated mail systems by starting with qmail and replacing parts as you went.

A company I co-founded used qmail for delivery for a webmail service for ~2m users, and while we used the original qmail less and less, it was because we were able to use qmail as scaffolding as described above.

And we ran lots of services under daemontools.

Later we used qmail as a generic message queueing system for a turnkey registrar platform for .name...

1 comments

Are you able to expand on how qmail was used / not used? I didn't think it was something that could be easily modified like that
In which context?

For the webmail provider, Qmail was used for all inbound/outgoing e-mail. Some modifications we made was to replace the delivery process with one that looked up the mail storage backend a given user was on and passed on the mail to qmails normal delivery process.

We also modified the delivery process to embed additional information in the message file names so that we could get away with just reading the directory to get file size (instead of additional stat() calls for each file), flag status etc.

Eventually we added quota checking and a cache of parsed header information (coupled with a custom command added to the POP server to list that info).

Qmail was ideal for that given that it consists of a bunch of small, easily understood components that all are documented extremely well and can be tested on the command line.

For the queueing system, any mail system works fine if your requirements does not include absolute ordering. All we needed to do was poll a Maildir (or POP server) to handle incoming messages, or inject outbound e-mail for outbound messages. It was fast and simple at a time when there was a distinct lack of open source dedicated queueing implementations.