Dump a user's mailbox to a file (e.g., .mbox) from server for archival My company has a policy that when an employee leaves, we need to dump their e-mail account and write it to a DVD to archive it.

How do you dump a particular user's e-mail into a .mbox or other archivable file format from the server (without access to the client-side of the user's e-mail account)?

I didn't see any options in the Server.app GUI, so is there a Terminal command I can use?
I ended up doing this via Terminal on the server.

cd /Library/Server/Mail/Data/mail
sudo ls -l users | grep &lt;username&gt;


(where  is the username you're looking for)

This returns the user's ID (e.g., 006638A6-9664-4CB4-8814-525A253B6E33)

sudo cp -a &lt;id&gt;/ ~/Desktop/&lt;username&gt;


This will copy the user's mail directory to a directory on the desktop. I then dumped that directory onto an external hard drive used for archiving former employees' mailboxes.

Thankfully we'll be switching away from macOS Server (which will be removing the Mail service in an upcoming update) to Exchange, so I won't have to deal with this anymore!