Import mail history
Export your old mailbox from Gmail or Apple Mail, then import its messages, labels, folders, and read state into an existing Samva mailbox.
Import an exported mailbox before moving its domain's incoming mail to Samva. The messages become history in the mailbox you choose. Importing does not deliver the messages again, trigger agents, forward mail, send automatic replies, or notify recipients.
Export from Gmail
- Open Google Takeout, choose Deselect all, then select Mail.
- Open All Mail data included and include the labels you want to move. Export all mail if you want the complete history.
- Choose Next step, create a one-time export, and download it when Google makes it available.
- Extract the downloaded archive. Use the
.mboxfile insideTakeout/Mail, rather than the ZIP file itself.
Keep the exported file intact. Gmail's label headers carry the message's labels and unread state.
Export from Apple Mail
- In Mail on your Mac, select the mailbox you want to export.
- Choose Mailbox → Export Mailbox, select a destination, and save the export.
- To include nested mailboxes, choose Export all subfolders when that option is available.
- Keep each
.mboxpackage together. A package is a directory containing anmboxfile,table_of_contents, andInfo.plist. You can import one package or the directory containing the exported package tree.
Exporting a mailbox differs from dragging individual messages out of Mail. Individual .eml files
are not an mbox export.
Import into an existing mailbox
Install and sign in to the CLI, then choose a mailbox you can update. For a
personal mailbox, use its owner's credentials. Find its ID with samva mailboxes list --json.
samva mailboxes import mbx_1234567890123456 "Takeout/Mail/All mail Including Spam and Trash.mbox"samva mailboxes import mbx_1234567890123456 "Mail export/Inbox.mbox"
samva mailboxes import mbx_1234567890123456 "Mail export"Use --dry-run to list the files and mailbox paths without uploading or importing anything.
The import command uploads the archive, starts the import, and shows progress until it completes.
A package tree uploads every nonempty exported mailbox into one import before processing starts.
The import counts cover the whole tree. Inbox uploads first, followed by Sent, Archive, and then
other mailbox paths. When copies of one message appear in several packages, this order chooses
the initial placement; later copies in the same import add their labels. Empty Apple Mail packages are
skipped locally and reported by path; they do not stop later mailboxes in the tree. --json returns the results with import IDs,
counts, failure reasons, source files, and a skippedEmpty list. Each Apple source file also
reports whether table_of_contents is present and which flag fallback applies.
samva mailboxes import mbx_1234567890123456 "Mail export" --dry-run --json
samva mailboxes import-status mbx_1234567890123456 <import-id> --jsonA job is queued, running, done, or failed. Compare the imported, duplicate, spam/trash, and
failed counts with the export's contents. Failed messages include a reason. A failed import or any
failed messages make the import command exit unsuccessfully while preserving the result.
How messages are filed
| Export | Placement and labels | Read and flag state |
|---|---|---|
| Gmail Takeout | Inbox messages are filed as Done so your new Inbox starts clean. Sent messages appear in Sent. Messages without Inbox or Sent are archived. Custom Gmail labels become labels. Spam and Trash are skipped. | Gmail's Unread label marks a message unread; other messages are read. Starred mail keeps its star. |
| Apple Mail | Inbox is Done; Sent and Sent Messages appear in Sent; Archive is archived. Other mailbox paths become labels, such as Clients/Invoices. | MIME Status and X-Status headers carry flags when present. Apple table_of_contents flags cannot be reliably decoded, so messages without MIME flags default to read and unflagged. |
| Other plain mbox | Messages are archived; export-carried Gmail labels are recognized when present. | MIME flags apply when present; otherwise messages are read and unflagged. |
Done archives Inbox history in a personal mailbox. In a shared mailbox, it clears the importing person's queue. Exported unread state is preserved without adding a personal Inbox badge.
Threads use exported thread identifiers when available, otherwise the message's reply headers. Importing keeps the message's original date and attachments. It creates no new live-mail events, approval items, screening holds, unread Inbox badge increments, or agent activity.
You can export again after changing your domain's mail routing and run the same command with the new export. Message IDs are deduplicated within the destination mailbox, so only the delta is added. Messages without a Message-ID use their content to detect repeats. This also makes it safe to retry an archive after a failure.
Importing refuses further messages when your organization's storage limit is reached. Already imported history remains available. Review the failure reason, free storage or change your plan, then retry.
Uploaded archives are retained for up to seven days so a failed import can resume. After that, export or upload the archive again; already imported messages remain and are deduplicated.