DBMAIL-EXPORT(8)
π dbmail-export β like, the manual page, bestie
okay so real talk: this is dbmail-export(8), one of the DBMail utilities, and it's genuinely iconic. buckle up π
β¨ NAME β¨
dbmail-export β exports a mailbox from DBMail straight into mbox format. no cap, that's the whole gig π¦
πΈ SYNOPSIS πΈ
dbmail-export [options] --user username --mailbox mailbox --out file
dbmail-export [options] --user username --mailbox mailbox --basedir directory
like, two whole ways to do it. pick your fighter π
π₯ DESCRIPTION π₯
The dbmail-export program is the one that lets you export a DBMail mailbox out into an mbox formatted mailbox. it's giving "moving out, packing my stuff, but make it email" π¦β¨
π OPTIONS π
-u,--user userβ tells it who owns the mailbox you're exporting. and yes you can use wildcards:?matches one character or none,*matches one or more characters in the username. sojoe*is a whole mood π«-m,--mailbox mailboxβ names the mailbox you wanna export. literally just the mailbox. slay.-o,--out outfileβ the file where your exported mail lands. pick it carefully bestie π-b,--basedir basedirβ the base directory where all the exported mailboxes get saved. this is the one you want when there's more than one mailbox coming out ποΈ-s,--search searchβ feed it an IMAP SEARCH string to pick which messages get exported. default is1:*. for example, to export everything received in May you'd go:"1:* SINCE 1-May-2007 BEFORE 1-Jun-2007". periodt, that's the syntax π-d,--set-del-flagβ flags the exported messages as\Deleted. heads up tho: you still needdbmail-utilto actually set the status to deleted. it's a two-step, not a one-and-done π-D,--set-del-statusβ sets the exported message status as deleted. and then, again,dbmail-utilis the one that purges. teamwork π«Ά-r,--recursiveβ exports mailboxes recursively. default istrueunless the-moption is also specified. so it flips itself off when you name a specific mailbox β iykyk π
π COMMON OPTIONS π
these bad boys show up across the DBMail utilities, so learn 'em once:
-f,--config configfileβ points at an alternate config file. to find the default location, rundbmail-<utility> --help. easy π-q,--quietβ quietly skips the interactive prompts and the helpful status messages that would otherwise be printed to stdout. stack two-q's and it also silences the errors that would otherwise go to stderr. shhh π€«-v,--verboseβ operates verbosely. some utilities in the DBMail suite accept two-v's for extra verbosity; the ones that don't understand the convention won't complain about the extra-v, they'll just keep operating at their normal verbosity. no drama, no error β-V,--versionβ shows the version and copyright, then exits. bye π-h,--helpβ shows a brief summary of options, then exits. also bye π
π§ EXAMPLES π§
okay bestie this first one is the classic. want to export and delete all of user Joe's messages in the Inbox that are more than 30 days old? on Linux, try this:
dbmail-export --user joe \
--mailbox inbox \
--out joesinbox.mbox \
--set-del-flag \
--search "1:* BEFORE `date '+%e-%b-%Y' -d '30 days ago'`"
and the BSD version, because of course the date flags are different:
dbmail-export --user joe \
--mailbox inbox \
--out joesinbox.mbox \
--set-del-flag \
--search "1:* BEFORE `date -v-30d '+%e-%b-%Y'`"
note the careful bash quoting and the backticks calling the date(1) command. date(1) has excellent features for retrieving relative dates β genuinely obsessed. if you're using a different shell, you may need different quotes, so watch yourself π
second vibe: exporting every mailbox named Spam for every user, each into its own directory following the pattern SpamDump/<username>/Spam. do this:
dbmail-export --user \* --mailbox Spam --basedir SpamDump
note the backslash β it stops the shell from expanding the *, because we want that * handed to DBMail so it can expand it against the internal user list. that backslash is the main character here π«Άβ¨
π¦ 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)
(yes dbmail-export(8) is listed in its own SEE ALSO. self-love π)
π 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 β honestly, bring the receipts π
β 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. legal slay, we Respect It π
π AUTHOR(S) π
DBMail is a collaborative effort among the core developers listed below, plus the tremendous help of the testers, patchers and bug hunters listed in the AUTHORS and THANKS files found in the DBMail source distribution. the way that a whole community showed up for this ππ
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 π
- DBMail announce mailing list
https://dbmail.org/wws/info/dbmail-announce/ - DBMail general mailing list
https://dbmail.org/wws/info/dbmail-general/ - DBMail Bug Tracker
https://github.com/dbmail/dbmail/issues
k that's the whole page, go export something iconic π
β¨ this has been DBMAIL-EXPORT(8), dated 08/28/2026, from the DBMail family of manual pages β mwah, love u, bye π«Άπ
π¦ where this page comes from
- arch rolling: dbmail 3.5.6-2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms