Google

G. Pape
qconfirm

qconfirm - cdb


How it works
How to configure qconfirm to use a constant database
qconfirm uses the filesystem, more precisely the qconfirm directory, as database to keep track of known, pending, and bad envelope sender ids and temporarily deferred messages.

If you run qconfirm for a public mail address that recieves a lot of mail from a lot of different senders (such as large mailing list) in message mode, there could be a great many of files in the ok/ directory. Normally a filesystem can handle a few thousands of files in a directory without performance problems. You can check the number of files in your ok/ directory by running ls -1 ~/.qconfirm/ok |wc -l.

If you run a lot of such mail addresses with qconfirm in message mode, the qconfirm directories could use a large number of inodes. You can check the inode usage of a filesystems by running df -i <device>.

If you encounter performance problems due to large directories, or if a filesystem holding qconfirm directories runs out of inodes, you should configure some mail addresses to use a constant database for known envelope sender ids. This should only happen on systems running a lot of mail addresses with qconfirm in message mode under a high mail load.

How it works

qconfirm-check still operates on its qconfirm directory. Unknown envelope sender mail addresses are additionally checked against a constant database before a delivery confirmation request is sent; the message will delivered without confirmation if the test was successful. Whenever a minimal number of new envelope sender mail addresses have confirmed delivery and so are known, they are transferred to the constant database, and deleted from the qconfirm directory:
  • For each message qconfirm-check is invoked for, it runs qconfirm-cdb-check if the envelope sender of the message is unknown and not pending. If qconfirm-cdb-check doesn't match the sender to be known, qconfirm-check requests delivery confirmation as usual. The message is allowed to be processed further in the dot-qmail file otherwise.
  • Whenever qconfirm-check requests a delivery confirmation from an envelope sender, it sets up the dot-qmail file that is supposed to handle the reply to the confirmation request to additionally run qconfirm-cdb-update when the sender confirms delivery.
The qconfirm-cdb-update maintains the constant database by adding a bunch of new known envelope sender address ids from the qconfirm directory to the database and removing old and obsolete ones from it.

How to configure qconfirm to use a constant database

Tell qconfirm-check to use the qconfirm-cdb-check program to match the envelope sender address against the constant database ~/.qconfirm/ok.cdb. To do so, edit the corresponding .qmail file and add qconfirm-cdb-check as prog argument to qconfirm-check like this:
  |envdir .qconfirm/conf qconfirm-check qconfirm-cdb-check
Tell qconfirm-check to set up qconfirm-cdb-update as prog argument to qconfirm-accept when creating temporary ~/.qmail-qconfirm-<key> files:
  $ echo 'qconfirm-cdb-update' >~/.qconfirm/conf/QCONFIRM_ACCEPT_PROG
Finally switch to your home directory and manually run qconfirm-cdb-update once to create the constant database ~/.qconfirm/ok.cdb and transfer ids from ~/.qconfirm/ok/:
  $ cd ~
  $ qconfirm-cdb-update -m0
qconfirm-cdb-update will be run automatically whenever an envelope sender confirms a delivery.
Gerrit Pape <pape@smarden.org>
$Id: cdb.html,v 1.1 2003/01/03 15:05:17 pape Exp $