DBMAIL-EXPORT(8)
================


NAME
----
dbmail-export - export a mailbox from the DBMail mailsystem to mbox format.

SYNOPSIS
--------
dbmail-export [-dr] [-u user] [-m mailbox] [-s imap search] [-o outfile|-b basedir] [-f configFile]

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

OPTIONS
-------
-u 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::
  specify the mailbox you want to export.

-o outfile::
  specify the file into which the exported mail will be saved.

-b basedir::
  specify the base directory into which the exported mailboxes will be saved.

-s 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::
  flag exported messages as \\Deleted (use dbmail-util to expunge).

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

include::commonopts.txt[]

EXAMPLES
--------

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

    dbmail-export -u joe -m inbox -o joesinbox.mbox -d -s "1:* BEFORE `date '+%e-%b-%Y' -d '30 days ago'`"

Note the careful bash quoting and backticks calling the GNU date(1) command.
GNU date(1) has excellent features for retrieving relative dates. If you are
using a different shell, you may need different quotes. Descriptions of
relative dates are not supported by BSD date(1).

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

    dbmail-export -u \* -m Spam -b 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.

include::footer.txt[]
