---
name: "dbmail-export"
section: "8"
platform: "linux"
package: "dbmail"
version: "3.5.6-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/dbmail-export"
---

# dbmail-export(8)

export a mailbox from DBMail to mbox format.

## NAME

dbmail-export - export a mailbox from DBMail to mbox format.

## SYNOPSIS

```
dbmail-export [options] --user username --mailbox mailbox --out file
dbmail-export [options] --user username --mailbox mailbox --basedir directory
```

## DESCRIPTION

The dbmail-export program allows you to export a DBMail mailbox to an mbox formatted mailbox.

## OPTIONS

- \-u, --user user

  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.

- \-m, --mailbox mailbox

  specify the mailbox you want to export.

- \-o, --out outfile

  specify the file into which the exported mail will be saved.

- \-b, --basedir basedir

  specify the base directory into which the exported mailboxes will be saved.

- \-s, --search search

  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"

- \-d, --set-del-flag

  flag exported messages as \\\\Deleted (use dbmail-util to set status to deleted).

- \-D, --set-del-status

  set exported message status as deleted (use dbmail-util to purge).

- \-r, --recursive

  export mailboxes recursively (default: true unless -m option also specified).

## 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.

## EXAMPLES

To export and delete all messages belonging to user *Joe* in mailbox *Inbox* more than 30 days old, try this command on Linux:

```
dbmail-export --user joe \
    --mailbox inbox \
    --out joesinbox.mbox \
    --set-del-flag \
    --search "1:* BEFORE `date '+%e-%b-%Y' -d '30 days ago'`"
```

A BSD version:

```
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 backticks calling the [date(1)](/date/1.md) command. [date(1)](/date/1.md) has excellent features for retrieving relative dates. If you are using a different shell, you may need different quotes.

To export all mailboxes named Spam for all users into individual directories following the pattern SpamDump/\<username\>/Spam, try this command:

```
dbmail-export --user \* --mailbox Spam --basedir SpamDump
```

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.

## SEE ALSO

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

## 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
