https://github.com/creativeprojects/imap
IMAP tools: backup, copy, move your emails between servers and locally
https://github.com/creativeprojects/imap
backup imap imap-tools imapsync maildir
Last synced: 10 months ago
JSON representation
IMAP tools: backup, copy, move your emails between servers and locally
- Host: GitHub
- URL: https://github.com/creativeprojects/imap
- Owner: creativeprojects
- Created: 2022-04-26T20:54:31.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2025-01-03T22:43:43.000Z (about 1 year ago)
- Last Synced: 2025-03-18T18:15:38.191Z (11 months ago)
- Topics: backup, imap, imap-tools, imapsync, maildir
- Language: Go
- Homepage:
- Size: 229 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# imap tools
[](https://codecov.io/gh/creativeprojects/imap)
Backup, copy, move your emails from and to IMAP servers. It can also load and save your emails locally.
## backend supported:
* IMAP
* [Maildir](https://en.wikipedia.org/wiki/Maildir) (**not** for Windows)
* Local database of compressed emails (boltDB)
## commands implemented:
* `list`: list mailboxes from the account
* `copy`: copy all messages from one account to another one (incremental copy)
* `history`: see an history of the actions on the account (only `copy` for now)
* `selfupdate`: update automatically to the newest version from Github releases
## keeping history for the incremental copy
The copy command will save a history of messages copied from the source. The history is saved on the destination backend. This is needed to associate the messages IDs of the source with the destination.
The way the history is saved is different for each backend:
* local: the history is saved in the database file
* Maildir: the history is saved in a file `.history.json`
* imap: the history is saved in a folder `.cache`
The incremental copy will break if you delete the history: all messages will be copied again.
## copying from multiple sources while keeping history
Each account is given an account ID so we can reference it in the history. The way this ID is generated depends on the backend:
* local: randomly generated at creation and saved in the database file
* Maildir: randomly generated at creation and saved in a file `.account.metadata.json`
* imap: generated from the server URL and login name (not saved anywhere)
## restart after error
After a connection to an IMAP server is lost, the current copy is saved in the history. It should restart from where it stopped if you rerun the `copy` command.
## configuration file
```yaml
---
accounts:
imap-user:
type: imap
serverURL: localhost:993
username: user@example.com
password: pass
skipTLSverification: true
maildir-test:
type: maildir
root: ./maildir-test
local-test:
type: local
file: ./local/test.db
```