Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Backup and Migrate IMAP Email Accounts

License

NotificationsYou must be signed in to change notification settings

joeyates/imap-backup

Repository files navigation

VersionBuild StatusCoverageLicenseStarsActivity

imap-backup

Backup, restore and migrate email accounts.

Quick Start

brew install imap-backup# for macOSgem install imap-backup --no-document# for Linuximap-backup setupimap-backup

Modes

There are two types of backups:

  • Keep all (the default) - progressively saves a local copy of all emails,
  • Mirror - adds and deletes emails from the local copy to keep it up to date with the account.

What You Can Do with a Backup

  • Migrate - use the local copy to populate emails on another account. This is a once-only action that deletes any existing emails on the destination account.
  • Mirror - make a destination account match the local copy. This action can be repeated.
  • Restore - push the local copy back to the original account.

See below for afull list of commands.

Installation

Docker or PodmanIf you have Docker or Podman installed, the easist way to use imap-backupis via the container image.

You'll need to choose a path on your computer where your backups will be saved,we'll use./my-data here.

If you have just one account, you can do as follows

docker run \  --volume ./my-data:/data \  --dns 8.8.8.8 \  ghcr.io/joeyates/imap-backup:latest \  imap-backup single backup \    --email me@example.com \    --password mysecret \    --server imap.example.com \    --path /data/me_example.com

Podman will work exactly the same.

Notes:

  • If you're using Docker, add--user $(id -u):$(id -g) so that the filescreated by the container are owned by you and not by root,
  • Pass imap-backup the--password-environment-variable=VARIABLE_NAME or--password-file=FILE option to avoid having your password inthe command line history:
docker run --env THE_PASSWORD=$THE_PASSWORD \  ... \  imap-backup single backup \    --password-environment-variable=THE_PASSWORD \    ...

or

docker run \  ... \  imap-backup single backup \    --password-file=/data/password.txt \    ...

If you have multiple accounts, you can create a configuration file.

You'll need to choose a path on your computer where your configuration will be saved,we'll use./my-config here.

First, run the menu-driven setup program to configure your accounts

docker run \  --volume ./my-config:/config \  --volume ./my-data:/data \  --dns 8.8.8.8 \  --tty \  --interactive \  ghcr.io/joeyates/imap-backup:latest \  imap-backup setup \    --config /config/imap-backup.json

Then, run the backup

docker run \  --volume ./my-config:/config \  --volume ./my-data:/data \  --dns 8.8.8.8 \  ghcr.io/joeyates/imap-backup:latest \  imap-backup backup \    --config /config/imap-backup.json
Homebrew (macOS)![Homebrew installs](https://img.shields.io/homebrew/installs/dm/imap-backup?label=Homebrew%20installs)

If you haveHomebrew, do this:

brew install imap-backup
As a Ruby Gem* [Rubygem]
gem install imap-backup --no-document

If that doesn't work, see thedetailed installation instructions.

From Source CodeIf you want to use imap-backup directly from the source code, see [here](/docs/installation/source.md).

Setup

Normally you will want to backup a number of email accounts.Doing so requires the creation of a config file.

You do this via a menu-driven command line program:

Run:

imap-backup setup

As an alternative, if you only want to backup a single account,you can pass all the necessary parameters directly to thesingle backup command(see thesingle backup docs).

GMail

To use imap-backup with GMail, Office 365 and other services that requireOAuth2 authentication, you can useemail-oauth2-proxy.Seethis blog post about using imap-backup with email-oauth2-proxy.

Backup

Manually, from the command line:

imap-backup

Alternatively, add it to your crontab.

Backups can also be inspected, for example vialocal showand exported viautils export-to-thunderbird.

Commands

For a full list of available commands, run

imap-backuphelp

For more information about a command, run

imap-backuphelp COMMAND

Performance

There are a couple of performance tweaks that you can useto improve backup speed.

These are activated via two settings:

  • Global setting "Delay download writes",
  • Account setting "Multi-fetch size".

Seethe performance document for more information.

Troubleshooting

If you have problems:

  1. ensure that you have the latest release,
  2. runimap-backup with the-v or--verbose parameter.

Development

See theDeveloper Documentation.


[8]ページ先頭

©2009-2025 Movatter.jp