dbmail-util

DBMAIL-UTIL(8)

NAME

dbmail-util - maintains the integrity and cleanliness of the DBMail
datatables.

SYNOPSIS

dbmail-util [-actbpds] [-l time] [-yn] [-qvVh] [-f configFile]

DESCRIPTION

The dbmail-util program offers a database cleanup and integrity check. All messages set for deletion (status 2) will be marked for final deletion (status 3). All message marked for final deletion will be cleared from the database. The integrity check will check for unconnected mimeparts, headervalues, messages and mailboxes.

By default, checks are read-only. Pass the -n option to respond no to any prompts. Pass the -y option to make read-write changes, responding yes to any prompts.

OPTIONS

-c
Clean up unlinked message entries.

-t
Test for message integrity.

-b
Check and rebuild the body/header/envelope cache tables.

-p
Remove all messages with a PURGE (3) value on status field. To purge messages currently marked with the DELETE (2) status, run with the -pd options twice. This is not recommended; it is better to leave a grace period for old messages before permanently wiping them from the database.

-d
Queue all messages marked with the DELETE (2) status for final purging, by setting the status value to PURGE (3). The status field is set to DELETE by either the IMAP-EXPUNGE or POP3-DELE commands.

-s
Remove dangling/invalid aliases and forwards.

-a
Perform the above checks: -c -t -b -p -d -s

Maintenance options

--rehash
Rebuild the hash values for all the message parts in the database. You need to run this after modifying the hash_algorithm config option.

-r time
Clear the reply cache used for autoreplies and Sieve vacations. The time is specified as [hours]h[minutes]m.

-l time
Clear the IP log used for IMAP/POP-before-SMTP. The time is specified as [hours]h[minutes]m.

--rehash
Rebuild the hash values for all the message parts in the database. You need to run this after modifying the hash_algorithm config option.

-e
Check for empty envelope cache.

Migration options

-M
Migrate legacy 2.2.x messageblks to mimeparts table.

-m limit [limit]
number of physmessages migrated. Default 10000 per run.

Common options

-n
Show the intended repairs without making any changes, i.e. no to all.

-y
Perform all repair actions , i.e. yes to all.

 

COMMON OPTIONS

-f configfile
 Specify an alternate config file. The utilities are currently
 hardcoded to use /etc/dbmail.conf for their configs, and will
 halt if the config file cannot be found. Use the -f configfile
 option to specify your system's preferred config file location.
 Debian is patched to have /etc/dbmail/dbmail.conf as the default.

-q
 Quietly skip interactive prompts and helpful status messages
 which would otherwise be printed to stdout. Use two -q's to
 silence errors which would otherwise be printed to stderr.

-v
 Operate verbosely. Some of the utilities in the DBMail suite
 can take two -v's for extra verbosity. Those which don't understand
 this convention won't complain about having the extra -v
 and will simply operate at their normal verbosity.

-V
 Show the version and copyright, then exit.

-h
 Show a brief summary of options, then exit.

RETURN VALUES

Returns 3 when errors are found but could not be fixed due to failure, 2 when
errors are found but '-y' was not provided or '-n' was provided, 1 when errors
are found and fixed successfully, 0 when no errors are found.


EXAMPLES

After upgrading from DBMail 2.0 or truncating the cache tables, run this command
to populate the cache:

`    dbmail-util -by`


To set all messages with the DELETE status to PURGE status, and permanently
remove all messages previously set to PURGE status:

`    dbmail-util -dpy`


To get a listing of the changes that would be performed for all actions:

`    dbmail-util -an`


To remove all IP log entries more than three days old:

`    dbmail-util -l 72h -y`

DBMail is sponsored by