The mfdbtool utility manages mailfromd databases.

Invoking mfdbtool
=================

The following options request the operation to be performed on the database.  Exactly one of them must be specified.  Each of them implied the --stderr option (see --stderr).

     list, mfdbtool

--list
     List the database.  By default, cache database is assumed.  To list another database, use --format option (see --format).

     See Basic Database Operations.

     delete, mfdbtool

--delete
     Delete given entries from the database (see deleting from databases).  By default, cache database is assumed.  To specify another database, use --format option (see --format).

     See Basic Database Operations.

     expire, mfdbtool

--expire
     Delete all expired entries from the database (see Database Maintenance).  By default, cache database is assumed.  To specify another database, use --format option (see --format).  Full database name can be given in the command line (see --file option below), if it differs from the one specified in the script file.

     Use with the option --all (see --all) to expire all databases.

     See Database Maintenance.

     compact, mfdbtool

--compact
     Compact database (see compaction).  By default, cache database is compacted.  To specify another database, use --format option (see --format).  Full database name can be given in the command line (see --file option below), if it differs from the one specified in the script file.

     Use with the option --all (see --all) to compact all databases.

     See compaction.

The following options modify the behavior of mfdbtool:

     all, mfdbtool

--all
     When used with --compact or --expire option, applies the action to all available databases.  See compact cronjob.

     debug, mfdbtool

-d STRING
--debug=STRING
     Sets debugging level.  The STRING argument must be a valid mailfromd debug level specification, as described in debugging level specification.

     expire-interval, mfdbtool

-e INTERVAL
--expire-interval=INTERVAL
     Set expiration intervals for all databases to the specified interval. See time interval specification, for a description of INTERVAL format.  The option overrides the expire-interval configuration statement (see expire-interval-conf), which you are advised to use instead.

     file, mfdbtool

-f FILENAME
--file=FILENAME
     Set the name of the database to operate upon (for --compact, --delete, --expire, and --list options). Useful if, for some reason, you need to operate on a database whose file name does not match the one mfdbtool is configured to use.

     format, mfdbtool

-H DBFORMAT
--format=DBFORMAT
     Use database of the given format, instead of the default cache.  See Basic Database Operations.

     ignore-failed-reads, mfdbtool

--ignore-failed-reads
     Ignore records that cannot be retrieved while compacting the database.  Without this option, mfdbtool will abort the compaction if any such error is encountered.

     predict, mfdbtool

--predict=RATE-LIMIT
     Used with --list enables printing of the estimated times of sending along with the rate database dump.  Implies --list --format=rate.  See estimated time of sending.

     state-directory, mfdbtool

--state-directory=DIR
     Sets program state directory.  See Local state directory, for the description of this directory and its purposes.  This option overrides the state-directory configuration statement, described in state-directory.

     time-format, mfdbtool

--time-format=FORMAT
     Set format to be used for timestamps in listings, produced by --list.  The FORMAT is any valid strftime format string, see Time and Date Formats, for a detailed description. The default FORMAT is %c (see %c time format).  To analyze mfdbtool --list output using text tools, such as awk or grep, the following format might be useful: %s (see %s time format).  Another format I find useful is %Y-%m-%d_%H:%M:%S.

Configuring mfdbtool
====================

Configuration settings are read from the /etc/mailfromd.conf file (see Mailfromd Configuration).  The following statements are understood:

Statement   Reference
database   see conf-database.
database-mode   see database-mode.
database-type   see database-type.
debug   see conf-calloutd-log.
lock-retry-count   see lock-retry-count.
lock-retry-timeout   see lock-retry-timeout.
state-directory   see state-directory.