Joshua Megerman <josh@honorablemenschen.com> wrote:
> My problem with the existing qmail code is that DJB went out of his way to
> a) avoid using system libraries (substdio anyone?) and b) write code that is
> difficult to understand at a glance (e.g., lots of single-letter variables).
It is perhaps unfair to judge djb's qmail code by modern standards; the code
is a product of its time. Lack of comments/documentation is a timeless
problem (and one certainly not limited to djb), but much of the unreadability
of the code comes from djb's relentless focus on first maximizing security,
and then secondly maximizing performance. Hand-unrolling loops, odd semantics
that are hard to read but easier for compilers of the time to optimize, etc --
they all take their toll. Avoiding system libraries was not (just) his
objecting to them on taste grounds; system libraries of the time were
historically garbage when it came to security, so he avoided them out of
necessity.
Times have changed. qmail, of course, has not.
> I think what qmail needs to move forward is a complete rewrite. Whether or
> not I'm going to do it is another question entirely :)
I've been thinking something similar for some years, and of course whether I
ever get to work on it is an open question, but a few notes:
Much of qmail's security comes from its modularity and closely-specified
interfaces between those modules. Part of the difficulty in extending some of
qmail's functionality comes from those interfaces being specified for minimal
resource use, etc. You could redefine these interfaces to use an extensible
data format of some sort and make it easier to add new functionality, without
necessarily sacrificing security.
Hardware has advanced by so many orders of magnitude since qmail was first
conceived that CPU and memory usage is normally not much of a limiting factor
for an MTA these days. You could rewrite some or all of the modules in qmail
in an easier-to-extend higher-level language (or even just more readable
modern C) without breaking anything, while making things more maintainable.
If the interfaces are specified, then there's no reason not to have multiple
conforming implementations of any given module (smtpd, smtpc, queue manager,
message injection, etc) that suit different purposes. Different people could
write different modules to agreed-upon interfaces.
I think the most difficult part of creating a new qmail-philosophy-inspired
MTA would be avoiding second-system syndrome.
Charles
--
--------------------------------------------------------------------------
Charles Cazabon
GPL'ed software available at:
http://pyropus.ca/software/ Read
http://pyropus.ca/personal/writings/12-steps-to-qmail-list-bliss.html --------------------------------------------------------------------------