DBMAIL-UTIL(8)

πŸ“¦ version 3.5.6, in arch rolling

πŸ’– DBMail-util(8) β€” the integrity-check bestie πŸ’–

okay so this is the manual page for dbmail-util, section 8 of the DBMail manuals, and honestly she's the one who keeps your database from becoming a whole mess. ✨


🌸 NAME 🌸

dbmail-util β€” she maintains the integrity and cleanliness of the DBMail datatables. that's it, that's the job, and she slays at it πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

dbmail-util [options] --all-checks
dbmail-util [options] --test-integrity
dbmail-util [options] --check-body
dbmail-util [options] --purge-deleted
dbmail-util [options] --set-deleted
dbmail-util [options] --clear-replycache time
dbmail-util [options] --clear-iplog time
dbmail-util [options] --rehash

πŸŽ€ DESCRIPTION πŸŽ€

so dbmail-util is literally the database cleanup + integrity check girlie. here's the tea:

  • every message that's been set for deletion (that's status 2) gets marked for final deletion (status 3) πŸ”₯
  • every message that's already marked for final deletion gets cleared right out of the database
  • and the integrity check goes looking for unconnected mimeparts, headervalues, messages and mailboxes β€” like, orphaned stuff just vibing with no home 🫢

big important thing bestie: by default, checks are read-only. pass the --no option to respond no to any prompts. pass the --yes option to make read-write changes, responding yes to any prompts. know the difference, it's giving main character energy vs. chaos gremlin energy πŸ’€


✨ OPTIONS ✨

  • -b, --check-body β€” check and rebuild the body/header/envelope cache tables 🧚
  • -d, --set-deleted β€” queue up all the messages marked with the DELETE (2) status for final purging, by setting the status value to PURGE (3). ngl, that status field gets set to DELETE by either the IMAP-EXPUNGE or POP3-DELE commands, iykyk
  • -p, --purge-deleted β€” remove all messages with a PURGE (3) value on the status field. wanna purge messages that are currently marked with the DELETE (2) status? you'd have to run with the -pd options twice. this is not recommended β€” it's way better to leave a grace period for old messages before permanently wiping them from the database 😭 πŸ™ˆ
  • -s, --remove-invalid-aliases β€” remove dangling/invalid aliases and forwards
  • -t, --test-integrity β€” test for message integrity
  • -a, --all-checks β€” performs all of the above checks: --check-body --set-deleted --purge-deleted --remove-invalid-aliases --test-integrity
  • -r, --clear-replycache time β€” clear the reply cache used for autoreplies and Sieve vacations. the time is specified as <hours>h<minutes>m (don't include the angle brackets, though!) ⭐
  • -l, --clear-iplog time β€” clear the IP log used for IMAP/POP-before-SMTP. the time is specified as <hours>h<minutes>m (don't include the angle brackets, though!)
  • --rehash β€” rebuild hash keys for stored messages
  • --erase days β€” delete messages older than date in INBOX/Trash
  • --move days β€” move messages from INBOX to INBOX/Trash
  • --inbox name β€” inbox folder to move from, used in conjunction with --move
  • --trash name β€” trash folder to move to, used in conjunction with --move

πŸ’… Common options

  • -n, --no β€” show the intended repairs without making any changes, i.e. no to all
  • -y, --yes β€” perform all repair actions, i.e. yes to all

🧰 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 πŸ‘‘
  • -e, --check-empty-cache β€” check for empty envelope cache

🚚 Migration options

  • -M, --migrate-legacy limit β€” migrate legacy 2.2.x messageblks to mimeparts table
  • -m, --migrate-limit limit β€” limit migration to [limit] number of physmessages. default 10000 per run

🌈 COMMON OPTIONS 🌈

  • -f, --config configfile β€” specify an alternate config file. use dbmail-<utility> --help to show the default location.
  • -q, --quiet β€” 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, --verbose β€” 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, --version β€” show the version and copyright, then exit
  • -h, --help β€” show a brief summary of options, then exit

⭐ RETURN VALUES ⭐

okay the exit codes, memorize them, they're literally the vibe check:

  • 3 β€” errors were found but could not be fixed due to failure πŸ’€
  • 2 β€” errors were found but -y was not provided, or -n was provided
  • 1 β€” errors were found and fixed successfully πŸŽ‰
  • 0 β€” no errors were found, immaculate, pristine, no notes πŸ‘‘

πŸ“ EXAMPLES πŸ“

regular maintenance can be run as a regular cron job:

dbmail-util --all --yes --verbose

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

dbmail-util --set-deleted --purge-deleted -yes

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

dbmail-util --all --no

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

dbmail-util --clear-iplog 72h --yes

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

dbmail-util --check-body --yes

πŸ”₯ SEE ALSO πŸ”₯

dbmail(1), dbmail.conf(5), dbmail-deliver(1), dbmail-export(8), dbmail-httpd(8), dbmail-imapd(8), dbmail-lmtpd(8), dbmail-pop3d(8), dbmail-sieved(8), dbmail-sievecmd(8), dbmail-users(8), dbmail-util(8)


πŸ› BUGS πŸ›

for the latest announcements, please subscribe to the DBMail announce mailing list[1]

for general discussion, please subscribe to the DBMail general mailing list[2]

if you experience an issue with DBMail, please report it on the DBMail Bug Tracker[3]. it may be helpful to have a debug log available 🫢


πŸ“œ LICENSE πŸ“œ

DBMail and its components are distributed under the terms of the GNU General Public License Version 2. Copyrights are held variously by the authors listed below.


πŸ‘‘ AUTHOR(S) πŸ‘‘

DBMail is a collaborative effort among the core developers listed below and the tremendous help of the testers, patchers and bug hunters listed in the AUTHORS and THANKS files found in the DBMail source distribution.

Alan Hicks          Persistent Objects Ltd https://p-o.co.uk
Eelco van Beek      Aaron Stone            Paul J Stevens
Roel Rozendaal      Open Source Engineer   NFG Net Facilities Group BV
Ilja Booij          Palo Alto, CA USA      http://www.nfg.nl
IC&S                                       http://www.ic-s.nl

πŸ’œ AUTHOR πŸ’œ

Alan Hicks <ahicks@p-o.co.uk> Author.


🧚 NOTES 🧚

  1. DBMail announce mailing list https://dbmail.org/wws/info/dbmail-announce/
  2. DBMail general mailing list https://dbmail.org/wws/info/dbmail-general/
  3. DBMail Bug Tracker https://github.com/dbmail/dbmail/issues

and that's the whole page bestie 🫢 this was DBMAIL-UTIL(8) from the DBMail source distribution, dated 08/28/2026. go forth and keep your database clean, no cap πŸ’–βœ¨

πŸ“¦ where this page comes from