The code here has a problem but it so happens it has no effect on its operation.
It uses two databases,
greylist.db and
whitelist.db.
The intention seems to be that key/value pairs representing SMTP clients are initially stored in
greylist.db then promoted to
whitelist.db (that's the gist, anyway). Due to a coding error in the
open_whitelist_db subroutine %db_hash gets tied to whitelist.db when it has already been tied to
greylist.db by a previous call to
open_database, in
smtpd_access_policy.
Since different keys were to be stored in the two databases anyway this does not affect the operation of the process, so having two databases was unnecessary.
I haven't check the code shipped with Mountain Lion (I can't upgrade this server to Mountain Lion as Apple have deemed its hardware to be too old).