Backup & restore an account

The backup and restore features are not yet natively included in Neverest CLI, yet you can manually back up and restore an account if one of its side (left or right) uses the Maildir backend. Let’s take the following example:

[accounts.posteo]
default = true
folder.filter.include = ["INBOX"]

left.backend.type = "maildir"
left.backend.root-dir = "~/Mail/posteo"

right.backend.type = "imap"
right.backend.host = "posteo.de"
right.backend.port = 993
right.backend.login = "clement.douin@posteo.net"
right.backend.passwd.cmd = "pass show posteo"

After running neverest sync, all emails are located in ~/Mail/posteo. You can easily back up your emails by running the following command:

$ tar cvzf posteo-backup-$(date +"%Y-%m-%d").tgz -C ~/Mail posteo

To restore your emails, just run the following:

$ mv ~/Mail/posteo ~/Mail/posteo-old
$ tar xvzf posteo-backup-2024-01-01.tgz -C ~/Mail