• Stars
    star
    273
  • Rank 149,801 (Top 3 %)
  • Language
    Python
  • License
    MIT License
  • Created almost 11 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Python script for incremental backups of IMAP mailboxes

Language grade: Python

imapbackup

A Python script for creating full backups of IMAP mailboxes

Background

This was first published around 2007 (probably earlier) on my personal site, and it was originally developed to work around the then rather limited (ok, inconsistent) Mac OS X Mail.app functionality and allow me to back up my old mailboxes in a fully standard mbox format (well, at least as much as mbox can be considered a standard...).

Somewhat to my surprise it was considered useful by quite a few people throughout the years, and contributions started coming in. Given that there seems to be renewed interest in this as a systems administration tool, I'm posting the source code here and re-licensing it under the MIT license.

Features

  • ZERO dependencies.
  • Copies every single message from every single folder (or a subset of folders) in your IMAP server to your disk.
  • Does incremental copying (i.e., tries very hard to not copy messages twice).
  • Tries to do everything as safely as possible (only performs read operations on IMAP).
  • Generates mbox formatted files that can be imported into Mail.app (just choose "Other" on the import dialog).
  • Optionally compresses the result files on the fly (and can append to them). Only available in Python 2.x
  • Is completely and utterly free (distributed under the MIT license).

Requirements

Python 2.x : imapbackup.py should work on Python 2.5 or any other 2.x version without any extra dependencies whatsoever. Python 3.x : imapbackup38.py requires python 3.8 and above.

Contributing

I am accepting pull requests, but bear in mind that one of the original goals of this script was to run on older Python versions, so as to save sysadmins stuck in the Dark Ages the trouble of installing a newer Python (much to my own amazement, this was originally written in Python 2.3).

I would be delighted to bring it fully up to date with Python 2.7.x/3.x, etc., and have considered adding multi-threading/multiprocessing to speed it up, but time is short enough as it is. If you feel up to the task just send me a pull request with a "new" main script with the target Python version as part of its name - something like imapbackup27.py, imapbackup39.py, etc.

Disclaimer

For tradition's sake, here goes:

IN NO EVENT WILL I BE LIABLE FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, THOSE RESULTING FROM LOST PROFITS, LOST DATA, LOST REVENUE OR BUSINESS INTERRUPTION) ARISING OUT OF THE USE, INABILITY TO USE, OR THE RESULTS OF USE OF, THIS PROGRAM. WITHOUT LIMITING THE FOREGOING, I SHALL NOT BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES THAT MAY RESULT FROM THE USE OF THIS SCRIPT OR ANY PORTION THEREOF WHETHER ARISING UNDER CONTRACT, NEGLIGENCE, TORT OR ANY OTHER LAW OR CAUSE OF ACTION. I WILL ALSO PROVIDE NO SUPPORT WHATSOEVER, OTHER THAN ACCEPTING FIXES AND UPDATING THE SCRIPT AS IS DEEMED NECESSARY.

More Repositories

1

raspi-cluster

Notes and scripts for setting up (yet another) Raspberry Pi computing cluster
C
255
star
2

textwrangler-bbedit-solarized

solarized color scheme for BBEdit and TextWrangler
Perl
174
star
3

rss2imap

An adaptation of rss2mail that uses IMAP directly
Python
85
star
4

sushy

A wiki/blogging engine with a static file back-end
Python
78
star
5

HJKLPlugin

A plugin for using vim movement keys (HJKL) to navigate messages and message lists in Mac OS X Mail
Python
63
star
6

bottle-fever

A clean-room clone of the Fever RSS aggregator, focusing on the API
Python
61
star
7

Yaki

A filesystem based wiki
Python
55
star
8

pythonium

This is an archive of a Python 3 to Javascript translator written in Python that produces fast portable javascript code
JavaScript
48
star
9

azure-docker-swarm-cluster

A simple, auto-scaling Docker Swarm cluster template for Azure
Makefile
47
star
10

pngcanvas

A minimalist library to render PNG images using pure Python
Python
44
star
11

python-webarchive

Create WebKit/Safari .webarchive files on any platform
Python
42
star
12

soup-strainer

A reimplementation of the Readability/Decruft algorithm using BeautifulSoup and html5lib
Python
33
star
13

python-utils

A set of libraries to allow for sane use of old Python runtimes
Python
30
star
14

docker-templates

A set of Docker templates (Dockerfiles and associated scripts)
Makefile
25
star
15

ink-bottle

A minimal skeleton for doing Bottle apps in a structured fashion (targeting Python 2.7 or above)
Python
24
star
16

newsfeed-corpus

A Dockerized RSS feed fetcher for NLP work, using asyncio
JavaScript
19
star
17

azure-toolbox

A Docker container with Azure Resource Manager administration tools and a machine/deep learning stack
Dockerfile
18
star
18

azure-stable-diffusion

An Azure template to run Stable Diffusion on a GPU-enabled spot instance
Makefile
17
star
19

ubuntu-python

A base Docker container for running Python apps with an Ubuntu userland
Makefile
15
star
20

azure-pipelines-multiarch-docker

A reference example on how to build multi-arch Linux images using Azure Pipelines
Makefile
14
star
21

azure-ubuntu-jitsi

A private Jitsi videoconferencing set up on Azure
Makefile
13
star
22

yaki-tng

A modern, revamped implementation of Yaki
JavaScript
13
star
23

homeworld

C
12
star
24

transducers-py

A (discontinued) attempt at creating a Python transducer library, done as a weekend project
Python
12
star
25

EyeFi-Config

Clone of git://git.sr71.net/eyefi-config.git
C
11
star
26

divmod.org

Archive of the old divmod.org SVN repo (snapshot from Launchpad)
Python
10
star
27

terraform-azure-linux-vm

An end-to-end, full-stack provisioning demo that can be used as a starting point for more complex solutions
Smarty
10
star
28

qsb-mac

Personal fork of (Google) Quick Search Box
Objective-C
9
star
29

azure-durable-functions-node-blog-engine

A simple blog engine and static site generator written as an Azure Durable Functions code sample
JavaScript
9
star
30

netbeans-clojure

A NetBeans plugin for Clojure support
Java
8
star
31

gnome-thumbnailers

My personal set of file thumbnailing utilities for GNOME 42+
Python
8
star
32

docker-ssh-bastion-armhf

A Docker container with a tailored SSH bastion
Shell
7
star
33

vagrant-templates

Templates for Vagrant VMs with useful snippets
Python
7
star
34

go-http-mdns

A minimal web server inside a Docker container for testing mDNS networking
Go
7
star
35

ground-init

Install a Linux machine locally with something that is almost, but not quite, cloud-init
Python
6
star
36

docker-plex-armhf

Run the Plex media server as a Docker container on the Raspberry Pi and other armhf machines
Makefile
6
star
37

docker-airprint-armhf

CUPS container for setting up an AirPrint server on armhf machines like the Raspberry Pi
C++
6
star
38

mqtt-feed-fetcher

An RSS feed fetcher that pipes new items to an MQTT topic
Hy
6
star
39

pink

An architectural Pattern for Ink
JavaScript
6
star
40

wasi-sqlite

sqlite3 CLI for a-Shell on iOS
C
5
star
41

android-signage-server

A companion server for the android signage client
Python
5
star
42

azure-golang-iothub

Experimental (minimalistic) client for Azure IoT Hub
Go
5
star
43

azure-iot-esp-01-minimal-cpp

The smallest Azure IoT Hub client in the world
C++
5
star
44

hy-there

A hylang playground
JavaScript
5
star
45

docker-homebridge

A Homebridge setup with the plugins I need, for armhf and x86_64
Makefile
3
star
46

azure-functions-bot

A reference bot design using Azure Functions
JavaScript
3
star
47

AirVideo

Python port of jphastings' excellent Ruby AirVideo client, enhanced with further functionality
Python
3
star
48

docker-zigbee2mqtt

Dockerized ZigBee gateway for my home setup
Makefile
3
star
49

hyrule

An improved REPL for HyLang
Python
3
star
50

kernseife

A fork of http://code.google.com/p/kernseife to scratch a few itches of mine. GPLv3.
3
star
51

terraform-azure-ha

a demo plan to deploy a high-availability scenario using an Azure Standard Load Balancer in HA mode
Smarty
3
star
52

docker-handbrake

A batch conversion wrapper for video files
Shell
2
star
53

azure-acme-foundation

A set of Azure Resource Manager templates and scripts for multi-tier, multi-tenant architectures
Python
2
star
54

azure-functions-bootstrap

An ARM template and additional boilerplate to build Azure Functions solutions
Makefile
2
star
55

aiogemini

A barebones Gemini protocol server written in async Python 3.x
Python
2
star
56

docker-other-video-transcoding

Don Melton's transcoding scripts as a Docker container
Shell
2
star
57

docker-homekit2mqtt

My personal setup
Makefile
2
star
58

docker-xmind

Dockerized Guacamole wrapper for legacy XMind 8
Dockerfile
2
star
59

openscad-kp3spro-filler

a spool holder arm for the KP3S Pro that uses the Filler modular system
OpenSCAD
2
star
60

rss2imap-gae

A reboot of rss2imap to run on Google App Engine
JavaScript
1
star
61

ansible-rancher

Ansible playbook to set up Rancher
1
star
62

loki-render

Loki Render with some tweaks
Java
1
star
63

PlasmaKit

Scripts and utilities for managing a set of plasma displays
JavaScript
1
star
64

ink-dash

A set of InkJS modules to build data-oriented displays
JavaScript
1
star
65

openscad-pikvm-case

a PiKVM case to hold a Raspberry Pi Zero W (or a Zero 2W) together with an HDMI-to-CSI bridge.
OpenSCAD
1
star
66

cogewebkit

A fork of http://code.google.com/p/cogewebkit/ that has a few extra properties (for now, essentially hiding the webview scrollbars)
1
star
67

docker-homeassistant

A Home Assistant container with the plugins I need
Makefile
1
star
68

openscad-vodafone-smart-router-base

A replacement base part for the Vodafone/Sagem ONT used by Vodafone Portugal
OpenSCAD
1
star
69

vagrant-docker

Docker provider for Vagrant 1.1
Ruby
1
star
70

azure-dev-bootstrap

An updated developer sandbox for Ubuntu 22.04 LTS, Node, Python and Go, accessible via Tailscale
Makefile
1
star
71

java-templates

A small collection of Java/Maven project templates for IDE-free development.
Java
1
star
72

yakitori

A test project to get my feet wet with Kotlin
Kotlin
1
star
73

raspbian-vlc-cross-compile

A Vagrantfile and assorted scripting to cross-compile VLC for Raspbian
Shell
1
star
74

http-benchmarks

Toy HTTP benchmarks for various runtimes
Makefile
1
star
75

docker-redis-build

experimental build scripts
Makefile
1
star
76

clj-nylon

A Textile markup parser for Clojure based on Instaparse
Clojure
1
star
77

aioazstorage

A thin asyncio wrapper for Azure Storage
Python
1
star