how hard would it be for libvpopmail to implement a "hook", where an external command (defined in a ~vpopmail/etc file) is executed whenever something changes- domains added or deleted, mailboxes or aliases added or deleted, passwords changed, etc...

some of you may be familiar with my "validrcptto.cdb" patch, which allows qmail-smtpd to check with a cdb file to determine whether or not a given RCPT argument is a valid email address on the system or not. this is an alternative to the "chkuser" patch, which i don't like because (1) it locks you into vpopmail, and (2) it only works if qmail-smtpd is running on the system where vpopmail is installed.

if you're not familiar with it, validrcptto.cdb.shtml describes it in more detail.

right now i'm having to run a service in the background which periodically checks the vpopmail directories and vpasswd.cdb files to see if anything has changed, and if so, it runs the "mkvalidrcptto" script (listed on the same web page.)

if vpopmail were to implement such a hook, i wouldn't have to use any kind of always-running background process to continually check the vpopmail directories- the idea is that vpopmail would trigger the rebuilding of the file whenever something changes.

of course, if the ~vpopmail/etc/____ file doesn't exist, no external process would be triggered.

and by building the functionality into libvpopmail, any change could trigger the hook process, no matter whether the change was caused by the command line tools, or qmailadmin, or vqadmin, or a vpopmaild command (when vpopmaild is ready.)

i'm wondering what people think about this- is it a good idea, or am i smoking crack? if so, how hard would it be to add into the source code? i imagine one function which would check the file, read it, make sure it contains a valid command (i.e. the first non-comment is a filename where access(___,X_OK) returns no errors), and then fork/ exec that command... and then every other function which changes something would call this new function.

of course my own validrcptto.cdb patch isn't the only reason something like this is needed- i would imagine there are other systems out there, particularly ISPs with custom billing system interfaces, which have a need to do something like updating a billing system database whenever something changes, and are currently using cron jobs to poll for changes- this would be beneficial for these types of users as well.

| John M. Simpson - KG4ZOW - Programmer At Large |
|           <[EMAIL PROTECTED]> |
| Mac OS X proves that it's easier to make UNIX  |
| pretty than it is to make Windows secure.      |

Attachment: PGP.sig
Description: This is a digitally signed message part

Reply via email to