Adam Prime wrote: > Charlie Brady wrote: >> But still very wasteful of system calls (and CPU). There are a million >> ways an admin could shoot herself in the foot - why should we check for >> this particular one over and over? > > I don't know the internals, but is the config really read over and over > again? It seems like something you'd read and parse once on startup, > and maybe read and parse again on a HUP or something. I don't see that > as a significant performance penalty. But again, i don't know the > internals.
I'm not precisely sure of the details, but register-hook seems to be called only once, even in multi-child async. I can tell because some of my plugin's register hooks emit log records ;-) Even if you call config() inside another hook on a per-rcptto basis, it just gets it out of the cache if it's not already there. Which means that the file is only opened once if you've issued a specific config(X) call in the register hook, and perhaps once-per-fork if you don't call config(X) in register(), and do it during a per email/per rcptto hook. Soooo, issuing a stat() call just before open() on the config file won't cost anything. You could insist on the file being owned by the qpsmtpd uid, and not world writable. That would resolve most difficulties.