All Projects → joeyates → Imap Backup

joeyates / Imap Backup

Licence: mit
Backup GMail (or other IMAP) accounts to disk

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Imap Backup

Imapbackup
A Python script for incremental backups of IMAP mailboxes
Stars: ✭ 156 (-70.11%)
Mutual labels:  backup, imap
Imapbox
Dump imap inbox to a local folder in a regular backupable format: html, json and attachements
Stars: ✭ 108 (-79.31%)
Mutual labels:  backup, imap
Telegram backup
Java app to download all your telegram data.
Stars: ✭ 409 (-21.65%)
Mutual labels:  backup
Roam To Git
Automatic RoamResearch backup to Git
Stars: ✭ 489 (-6.32%)
Mutual labels:  backup
Qzoneexport
QQ空间导出助手,用于备份QQ空间的说说、日志、私密日记、相册、视频、留言板、QQ好友、收藏夹、分享、最近访客为文件,便于迁移与保存
Stars: ✭ 456 (-12.64%)
Mutual labels:  backup
Mailkit
A cross-platform .NET library for IMAP, POP3, and SMTP.
Stars: ✭ 4,477 (+757.66%)
Mutual labels:  imap
Gobackup
🗄 Simple tool for backup your databases, files to FTP / SCP / S3 storages.
Stars: ✭ 472 (-9.58%)
Mutual labels:  backup
Mail
Library to send e-mails over different transports and protocols (like SMTP and IMAP) using immutable messages and streams. Also includes SMTP server.
Stars: ✭ 399 (-23.56%)
Mutual labels:  imap
Backup
Easy full stack backup operations on UNIX-like systems.
Stars: ✭ 4,682 (+796.93%)
Mutual labels:  backup
Neutron
Self-hosted server for the ProtonMail client
Stars: ✭ 452 (-13.41%)
Mutual labels:  imap
James Project
Emails at the heart of your business logic!
Stars: ✭ 485 (-7.09%)
Mutual labels:  imap
Sieve
Sieve Script Editor
Stars: ✭ 452 (-13.41%)
Mutual labels:  imap
Kube Backup
💾 Kubernetes resource state sync to git
Stars: ✭ 419 (-19.73%)
Mutual labels:  backup
Django Dbbackup
Management commands to help backup and restore your project database and media files
Stars: ✭ 471 (-9.77%)
Mutual labels:  backup
Laravel Imap
Laravel IMAP is an easy way to integrate both the native php-imap module and an extended custom imap protocol into your Laravel app.
Stars: ✭ 416 (-20.31%)
Mutual labels:  imap
Rdiff Backup
Reverse differential backup tool, over a network or locally.
Stars: ✭ 510 (-2.3%)
Mutual labels:  backup
Wikiteam
Tools for downloading and preserving wikis. We archive wikis, from Wikipedia to tiniest wikis. As of 2020, WikiTeam has preserved more than 250,000 wikis.
Stars: ✭ 404 (-22.61%)
Mutual labels:  backup
Twisted
Event-driven networking engine written in Python.
Stars: ✭ 4,442 (+750.96%)
Mutual labels:  imap
Signal Back
Decrypt Signal encrypted backups outside the app
Stars: ✭ 468 (-10.34%)
Mutual labels:  backup
Mt Aws Glacier
Perl Multithreaded Multipart sync to Amazon Glacier
Stars: ✭ 522 (+0%)
Mutual labels:  backup

Build Status Source Analysis Test Coverage

imap-backup

Backup GMail (or other IMAP) accounts to disk

GMail

GMail OAuth2 authentication is supported.

To set it up, follow the HOWTO.

Installation

$ gem install 'imap-backup'

Setup

In order to do backups, you need to add accounts via a menu-driven command line program:

Run:

$ imap-backup setup

Folders

By default, all folders are backed-up. You can override this by choosing specific folders.

Configuration file

setup creates the file ~/.imap-backup/config.json

E.g.:

{
  "accounts": [
    {
      "username": "[email protected]",
      "password": "secret",
      "local_path": "/path/to/backup/root",
      "folders":
        [
          {"name": "[Gmail]/All Mail"},
          {"name": "my_folder"}
        ]
    }
  ]
}

It connects to GMail by default, but you can also specify a server:

{
  "accounts": [
    {
      "username": "[email protected]",
      "password": "secret",
      "server": "my.imap.example.com",
      "local_path": "/path/to/backup/root",
      "folders":
        [
          {"name": "[Gmail]/All Mail"},
          {"name": "my_folder"}
        ]
    }
  ]
}

Connection options

You can override the parameters passed to Net::IMAP with connection_options.

Specifically, if you are using a self-signed certificate and get SSL errors, e.g. certificate verify failed, you can choose to not verify the TLS connection:

{
  "accounts": [
    {
      "username": "[email protected]",
      "password": "secret",
      "server": "my.imap.example.com",
      "local_path": "/path/to/backup/root",
      "folders": [
        {"name": "[Gmail]/All Mail"},
        {"name": "my_folder"}
      ],
      "connection_options": {
        "ssl": {"verify_mode": 0},
        "port": 993
      }
    }
  ]
}

Security

Note that email usernames and passwords are held in plain text in the configuration file.

The directory ~/.imap-backup, the configuration file and all backup directories have their access permissions set to only allow access by your user.

Run Backup

Manually, from the command line:

$ imap-backup

Alternatively, add it to your crontab.

Result

Each folder is saved to an mbox file. Alongside each mbox is a file with extension '.imap', which lists the source IMAP UIDs to allow a full restore.

Troubleshooting

If you have problems:

  1. ensure that you have the latest release,
  2. turn on debugging output:
{
  "accounts":
  [
    ...
  ],
  "debug": true
}

Restore

All missing messages are pushed to the IMAP server. Existing messages are left unchanged.

This functionality requires that the IMAP server supports the UIDPLUS extension to IMAP4.

Other Usage

List IMAP folders:

$ imap-backup folders

Get statistics of emails to download per folder:

$ imap-backup status

Design Goals

  • Secure - use a local file protected by permissions
  • Restartable - calculate start point based on already downloaded messages
  • Standalone - do not rely on an email client or MTA

Similar Software

Testing

Integration Tests

Integration tests (feature specs) are run against a Docker image (antespi/docker-imap-devel:latest).

In one shell, run the Docker image:

$ docker run \
  --env MAIL_ADDRESS=[email protected] \
  --env MAIL_PASS=pass \
  --env MAILNAME=example.org \
  --publish 8993:993 \
  antespi/docker-imap-devel:latest
$ rake

To exclude Docker-based tests:

rake no-docker

or

$ rspec --tag ~docker

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].