A cli utility for dumping emails as EML files to a folder.
Project description
imapdump
imapdump is a cli based tool to export an IMAP account to a local folder.
Installation
Install the module from PyPI:
$ pip install imapdump
or simply run it using uvx (recommended):
$ uvx imapdump [args...]
Usage
Launch the application via the included command imapdump.
You may also run it using uv tool run (recommended method).
# regular pip install
$ imapdump -h
# ...or uvx
$ uvx imapdump -h
usage: imapdump [-h] [-l {critical,fatal,error,warn,info,debug}] [--use-logfile] [--logfile-path LOGFILE_PATH]
[--logfile-level {critical,fatal,error,warn,info,debug}] [--host HOST] [-f DATABASE_FILE] [-p PORT]
[-u USERNAME] [--password PASSWORD] [--encryption-mode {none,ssl,starttls}] [--folder-regex FOLDER_REGEX]
[--recreate | --mirror] [--dry-run] [--dump-folder DUMP_FOLDER] [-c ADDITIONAL_CONFIG_FILES]
Dump an IMAP account to a local directory
options:
-h, --help show this help message and exit
-l, --logging {critical,fatal,error,warn,info,debug}
Console log level (default: info)
--use-logfile Write log files (default: False)
--logfile-path LOGFILE_PATH
File to write log entries into (default: imapdump.log)
--logfile-level {critical,fatal,error,warn,info,debug}
Log files log level (default: info)
--host HOST Hostname of the IMAP server (default: 127.0.0.1)
-f, --file DATABASE_FILE
Database file (default: .imapdump-cache.db)
-p, --port PORT Port of the IMAP server (default: 993)
-u, --username USERNAME
Username for the IMAP account (default: None)
--password PASSWORD Password of the IMAP account (default: None)
--encryption-mode {none,ssl,starttls}
IMAP encryption mode (default: ssl)
--folder-regex FOLDER_REGEX
Pattern to match against for including folders (default: ^.*$)
--recreate Recreate cache and recreate the dump directory (destructive, this will delete dumped files!),
then dump all matching messages (default: False)
--mirror Remove all unknown files and folders from output folder and exactly mirror server state (default:
False)
--dry-run Only simulate what would be done, don't actually write/change anything (default: False)
--dump-folder DUMP_FOLDER
Where to dump .eml files to (default: dumped_mails)
-c, --config ADDITIONAL_CONFIG_FILES
Supply a config file (can be specified multiple times) (default: None)
Configuration
Create a config.yml.
Example configuration:
host: imap.example.com
username: user
password: supers3cr3tp4ssw0rd
dump_folder: /path/to/dump/folder
All possible settings:
host: imap.example.com
port: 993
username: user
password: supers3cr3tp4ssw0rd
database_file: .imapdump-cache.db
encryption_mode: ssl
folder_regex: ^.*$
dump_folder: /path/to/dump/folder
Then run the application:
$ imapdump -l debug --config config.yml --mirror
Open Source License Attribution
This application uses Open Source components. You can find the source code of their open source projects along with license information below. We acknowledge and are grateful to these developers for their contributions to open source.
dacite
- Copyright (c) Konrad Hałas and contributors
- MIT License
PyYAML
- Copyright (c) The YAML Project and contributors
- MIT License
imapclient
- Copyright (c) 2014 Menno Smits and contributors
- New BSD License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file imapdump-0.7.3.tar.gz.
File metadata
- Download URL: imapdump-0.7.3.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99c98d16965b84c13c9a9af074d2585e1fb6bd2d5f5c2fa3f4565cd00ec9daed
|
|
| MD5 |
9714b2415626803a0c847f0ba8fe6f93
|
|
| BLAKE2b-256 |
0767fcecd5b8e3fd171c16ecced3b180285119b2fa707e8911ee04d40b0b050c
|
Provenance
The following attestation bundles were made for imapdump-0.7.3.tar.gz:
Publisher:
python-publish.yml on das-kaesebrot/imapdump
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imapdump-0.7.3.tar.gz -
Subject digest:
99c98d16965b84c13c9a9af074d2585e1fb6bd2d5f5c2fa3f4565cd00ec9daed - Sigstore transparency entry: 771851521
- Sigstore integration time:
-
Permalink:
das-kaesebrot/imapdump@3ff36ff15bb559531bd2f03ded1c6aa764c7fdd0 -
Branch / Tag:
refs/tags/v0.7.3-beta - Owner: https://github.com/das-kaesebrot
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3ff36ff15bb559531bd2f03ded1c6aa764c7fdd0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file imapdump-0.7.3-py3-none-any.whl.
File metadata
- Download URL: imapdump-0.7.3-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
166db33f39738a1a7c7a35aa1a815b5c5608e7458a003df0f762f13368e8b22b
|
|
| MD5 |
566f2f15527e70e00166af7da33633c6
|
|
| BLAKE2b-256 |
55cc905d87661271348d1c1f3401d55eb872a9c85ca8e2a069e16d1b108925f9
|
Provenance
The following attestation bundles were made for imapdump-0.7.3-py3-none-any.whl:
Publisher:
python-publish.yml on das-kaesebrot/imapdump
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
imapdump-0.7.3-py3-none-any.whl -
Subject digest:
166db33f39738a1a7c7a35aa1a815b5c5608e7458a003df0f762f13368e8b22b - Sigstore transparency entry: 771851525
- Sigstore integration time:
-
Permalink:
das-kaesebrot/imapdump@3ff36ff15bb559531bd2f03ded1c6aa764c7fdd0 -
Branch / Tag:
refs/tags/v0.7.3-beta - Owner: https://github.com/das-kaesebrot
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@3ff36ff15bb559531bd2f03ded1c6aa764c7fdd0 -
Trigger Event:
push
-
Statement type: