Skip to content

Export & Import

Export and import commands let you save inboxes with their encryption keys for backup, sharing, or migrating between machines.

Export an inbox with its encryption keys to a JSON file.

Terminal window
vsb export [email-address] [flags]
ArgumentDescription
email-addressInbox to export (uses active inbox if omitted)
FlagDescription
--outOutput file path (default: <email>.json)
Terminal window
# Export active inbox
vsb export
# Export specific inbox
# Export to specific file
vsb export [email protected] --out backup.json
✓ Export complete

A security warning is displayed reminding you that the file contains private keys.

The export file is a JSON document containing:

{
"version": 1,
"emailAddress": "[email protected]",
"inboxHash": "abc123",
"expiresAt": "2024-01-16T14:30:00Z",
"exportedAt": "2024-01-15T14:30:00Z",
"keys": {
"kemPrivate": "...",
"kemPublic": "...",
"serverSigPk": "..."
}
}

Import an inbox from an export file.

Terminal window
vsb import <file> [flags]
ArgumentDescription
filePath to export file
FlagDescription
-l, --localSkip server verification
-f, --forceOverwrite if inbox already exists
Terminal window
# Import inbox
vsb import backup.json
# Import and overwrite existing
vsb import backup.json -f
# Skip server verification
vsb import backup.json -l
✓ Inbox verified: 5 emails
Import Complete
Expires: 720h0m0s
This inbox is now your active inbox.
Run 'vsb' to see emails.
Terminal window
# Export before deleting
vsb export [email protected] --out backup.json
vsb inbox delete [email protected] --force
# Later, restore if needed
vsb import backup.json
Terminal window
# On machine A: Export
vsb export [email protected] --out shared-inbox.json
# Transfer file securely (scp, encrypted email, etc.)
scp shared-inbox.json user@machine-b:~/
# On machine B: Import
vsb import ~/shared-inbox.json

Instead of creating new inboxes for each CI run, you can use a persistent inbox:

.github/workflows/test.yml
jobs:
test:
steps:
- name: Import test inbox
run: |
echo '${{ secrets.TEST_INBOX_EXPORT }}' > inbox.json
vsb import inbox.json -f
- name: Run tests
run: ./run-email-tests.sh

Share a test inbox with your team:

Terminal window
# Create and export a shared inbox
vsb inbox create --ttl 30d
vsb export --out team-test-inbox.json
# Store in secure location (password manager, encrypted vault)
# Team members import on their machines