'\" t .\" Title: dbmail-export .\" Author: Alan Hicks .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 07/15/2026 .\" Manual: \ \& .\" Source: \ \& .\" Language: English .\" .TH "DBMAIL\-EXPORT" "8" "07/15/2026" "\ \&" "\ \&" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" dbmail-export \- export a mailbox from DBMail to mbox format\&. .SH "SYNOPSIS" .sp .nf dbmail\-export [options] \-\-user username \-\-mailbox mailbox \-\-out file dbmail\-export [options] \-\-user username \-\-mailbox mailbox \-\-basedir directory .fi .SH "DESCRIPTION" .sp The dbmail\-export program allows you to export a DBMail mailbox to an mbox formatted mailbox\&. .SH "OPTIONS" .PP \-u, \-\-user user .RS 4 specify the owner of the mailbox you want to export, using wildcards ? and * to match one or none, or one or more characters in the username, respectively\&. .RE .PP \-m, \-\-mailbox mailbox .RS 4 specify the mailbox you want to export\&. .RE .PP \-o, \-\-out outfile .RS 4 specify the file into which the exported mail will be saved\&. .RE .PP \-b, \-\-basedir basedir .RS 4 specify the base directory into which the exported mailboxes will be saved\&. .RE .PP \-s, \-\-search search .RS 4 use an IMAP SEARCH string to select messages (default: 1:*) for example, to export all messages received in May, use: "1:* SINCE 1\-May\-2007 BEFORE 1\-Jun\-2007" .RE .PP \-d, \-\-set\-del\-flag .RS 4 flag exported messages as \e\eDeleted (use dbmail\-util to set status to deleted)\&. .RE .PP \-D, \-\-set\-del\-status .RS 4 set exported message status as deleted (use dbmail\-util to purge)\&. .RE .PP \-r, \-\-recursive .RS 4 export mailboxes recursively (default: true unless \-m option also specified)\&. .RE .SH "COMMON OPTIONS" .PP \-f, \-\-config configfile .RS 4 Specify an alternate config file\&. Use dbmail\- \-\-help to show the default location\&. .RE .PP \-q, \-\-quiet .RS 4 Quietly skip interactive prompts and helpful status messages which would otherwise be printed to stdout\&. Use two \-q\(cqs to silence errors which would otherwise be printed to stderr\&. .RE .PP \-v, \-\-verbose .RS 4 Operate verbosely\&. Some of the utilities in the DBMail suite can take two \-v\(cqs for extra verbosity\&. Those which don\(cqt understand this convention won\(cqt complain about having the extra \-v and will simply operate at their normal verbosity\&. .RE .PP \-V, \-\-version .RS 4 Show the version and copyright, then exit\&. .RE .PP \-h, \-\-help .RS 4 Show a brief summary of options, then exit\&. .RE .SH "EXAMPLES" .sp To export and delete all messages belonging to user \fIJoe\fR in mailbox \fIInbox\fR more than 30 days old, try this command on Linux: .sp .if n \{\ .RS 4 .\} .nf dbmail\-export \-\-user joe \e \-\-mailbox inbox \e \-\-out joesinbox\&.mbox \e \-\-set\-del\-flag \e \-\-search "1:* BEFORE `date \*(Aq+%e\-%b\-%Y\*(Aq \-d \*(Aq30 days ago\*(Aq`" .fi .if n \{\ .RE .\} .sp A BSD version: .sp .if n \{\ .RS 4 .\} .nf dbmail\-export \-\-user joe \e \-\-mailbox inbox \e \-\-out joesinbox\&.mbox \e \-\-set\-del\-flag \e \-\-search "1:* BEFORE `date \-v\-30d \*(Aq+%e\-%b\-%Y\*(Aq`" .fi .if n \{\ .RE .\} .sp Note the careful bash quoting and backticks calling the date(1) command\&. date(1) has excellent features for retrieving relative dates\&. If you are using a different shell, you may need different quotes\&. .sp To export all mailboxes named Spam for all users into individual directories following the pattern SpamDump//Spam, try this command: .sp .if n \{\ .RS 4 .\} .nf dbmail\-export \-\-user \e* \-\-mailbox Spam \-\-basedir SpamDump .fi .if n \{\ .RE .\} .sp Note the backslash to prevent the shell from expanding the *, as we want that * to be passed into DBMail for expansion based on the internal user list\&. .SH "SEE ALSO" .sp 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) .SH "BUGS" .sp For the latest announcements, please subscribe to the \m[blue]\fBDBMail announce mailing list\fR\m[]\&\s-2\u[1]\d\s+2 .sp For general discussion, please subscribe to the \m[blue]\fBDBMail general mailing list\fR\m[]\&\s-2\u[2]\d\s+2 .sp If you experience an issue with DBMail, please report it on the \m[blue]\fBDBMail Bug Tracker\fR\m[]\&\s-2\u[3]\d\s+2\&. It may be helpful to have a debug log available\&. .SH "LICENSE" .sp 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\&. .SH "AUTHOR(S)" .sp 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\&. .sp .if n \{\ .RS 4 .\} .nf 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 .fi .if n \{\ .RE .\} .SH "AUTHOR" .PP \fBAlan Hicks\fR <\&ahicks@p\-o\&.co\&.uk\&> .RS 4 Author. .RE .SH "NOTES" .IP " 1." 4 DBMail announce mailing list .RS 4 \%https://dbmail.org/wws/info/dbmail-announce/ .RE .IP " 2." 4 DBMail general mailing list .RS 4 \%https://dbmail.org/wws/info/dbmail-general/ .RE .IP " 3." 4 DBMail Bug Tracker .RS 4 \%https://github.com/dbmail/dbmail/issues .RE