SPAMDB(8)               OpenBSD System Manager's Manual              SPAMDB(8)

NAME
     spamdb - spamd database tool

SYNOPSIS
     spamdb [-Tt] [-a key] [-d key]

DESCRIPTION
     spamdb manipulates the spamd database in /var/db/spamd used for spamd(8)
     greylisting.

     The options are as follows:

     -a key  Add or update an entry for key.  This can be used to whitelist an
             IP address (i.e. circumvent the greylisting process altogether)
             by adding it to the spamd database as a WHITE entry.  If the key
             specified matches an entry already in the spamd database, spamdb
             updates the entry's time last seen to now.

     -d key  Delete an entry for key.

     -T      Add or delete the key as a SPAMTRAP entry.  See the GREYTRAPPING
             section of spamd(8) for more information.  Must be used in con-
             junction with the -a or -d option.

     -t      Add or delete the key as a TRAPPED entry.  See the GREYTRAPPING
             section of spamd(8) for more information.  Must be used in con-
             junction with the -a or -d option.

     If adding or deleting a SPAMTRAP address (-T), key should be specified as
     an email address:

           <spamtrap@mydomain.org>

     Otherwise key should be a numerical IP address.

   DATABASE OUTPUT FORMAT
     If invoked without any arguments, spamdb lists the contents of the
     database in a text format.  For SPAMTRAP entries the format is:

           type|mailaddress

     where type will be SPAMTRAP and mailaddress will be the email address for
     which any connections received by spamd(8) will be blacklisted if mail is
     sent to this address.

     For TRAPPED entries the format is:

           type|ip|expire

     where type will be TRAPPED, ip will be the IP address blacklisted due to
     hitting a spamtrap, and expire will be when the IP is due to be removed
     from the blacklist.

     For GREY or WHITE entries, the format is:

           type|source ip|from|to|first|pass|expire|block|pass

     The fields are as follows:

           type       WHITE if whitelisted or GREY if greylisted
           source ip  IP address the connection originated from
           from       envelope-from address for GREY (empty for WHITE entries)
           to         envelope-to address for GREY (empty for WHITE entries)
           first      time the entry was first seen
           pass       time the entry passed from being GREY to being WHITE
           expire     time the entry will expire and be removed from the
                      database
           block      number of times a corresponding connection received a
                      temporary failure from spamd(8)
           pass       number of times a corresponding connection has been seen
                      to pass to the real MTA by spamlogd(8)

     Note that times are in seconds since the Epoch, in the manner returned by
     time(3).  Times may be converted to human readable format using:

           $ date -r <value>

FILES
     /var/db/spamd

SEE ALSO
     spamd.conf(5), spamd(8), spamd-setup(8)

HISTORY
     The spamdb command appeared in OpenBSD 3.5.

OpenBSD 4.0                    February 16, 2004                             2
