jsms: sendmail must die completes itself

Jonathan Walther krooger@debian.org
Thu, 8 Jul 1999 02:39:24 -0700 (PDT)


On Thu, 8 Jul 1999, Rick Moen wrote:
> > The elegant simplicity of the interface will inspire the elegant simplicity
> > of the code architecture.
> 
> One might hope for this, but could not rationally expect it.  Still,
> best of luck on your project.

When you implement an interface, the clearer the  interface is, the clearer
the code is, in my experience.  With a clear interface, you aren't
distracted by 101 features to toss in... you implement the presented
features.  Then later you can add in extras, but with a clean architecture.

My architecture is relatively simple: a mail will come in, and depending on
which domain its addressed to, the "context" struct for that domain will be
looked up, where all the predetermined decisions about its routing are
stored, which is then just followed.  No CPU cycles stolen in the heat of
battle, just simple lookups.

Because of my use of structs for context, its relatively simple to use the
kill -HUP trick to reread files, my init routine is reentrant. Goes like
this: fill up newly allocated structs, copy curr pointer to temp pointer,
clobber curr pointer with your new pointer, then free up the entire tree of
structs the pointer you just copied points to.  Whichever thread finishes
last, is the one whose "reading" of the config file sticks in memory.

All relaying is turned off by default; even relaying from localhost has to
be specifically enabled, which it is in the default config files.

Jonathan