forked from rcarmo/imapbackup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.example.yaml
More file actions
165 lines (135 loc) · 4.94 KB
/
config.example.yaml
File metadata and controls
165 lines (135 loc) · 4.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# IMAP Backup Configuration File
# This file allows you to backup multiple email accounts with a single command
# Global settings (applied to all accounts unless overridden)
global:
# Base directory for all backups (each account gets a subdirectory)
basedir: ./backups
# Use date-based folders (creates date subdirectories)
# When enabled: basedir/account_name/{date}/
# When disabled: basedir/account_name/
use_date_folders: false
# Date format for folder names (Python strftime format)
# Examples:
# %Y-%m-%d -> 2025-10-10 (default)
# %Y/%m/%d -> 2025/10/10
# %Y-%m-%d_%H-%M -> 2025-10-10_14-30
# %Y-week-%U -> 2025-week-41
# %Y/%B/%d -> 2025/October/10
date_format: '%Y-%m-%d'
# Use SSL for all connections
ssl: true
# Timeout in seconds
timeout: 60
# Disable spinner (useful for logs)
nospinner: false
# S3 configuration (optional, can be overridden per account)
s3:
enabled: true
endpoint: https://s3.eu-central-1.hetzner.cloud
bucket: email-backups
access_key: YOUR_S3_ACCESS_KEY
secret_key: YOUR_S3_SECRET_KEY
# Base prefix for all accounts (account name will be appended)
prefix: backups
# GPG encryption (optional, can be overridden per account)
gpg:
enabled: true
recipient: backup@example.com
# Import public key from file, URL, or environment variable
import_key: https://example.com/keys/backup-public.asc
# Or use: env:GPG_PUBLIC_KEY
# Or use: /path/to/public-key.asc
# Email accounts to backup
accounts:
# Account 1: Gmail
- name: personal-gmail
server: imap.gmail.com
port: 993 # Optional, defaults to 993 for SSL, 143 for non-SSL
user: myemail@gmail.com
# Password options (choose one):
# 1. Direct password (not recommended for production)
pass: my_password
# 2. Password from file (recommended)
# pass: @/path/to/password/file
# 3. Password from environment variable
# pass: env:GMAIL_PASSWORD
# Optional: folders to backup (comma-separated)
# If not specified, all folders are backed up
folders: INBOX,Sent,Important
# Optional: folders to exclude
# exclude_folders: Trash,Spam
# Optional: override global S3 prefix
# s3_prefix: gmail-backup
# Optional: account-specific GPG recipient
# gpg_recipient: personal-backup@example.com
# Account 2: Office 365
- name: work-office365
server: outlook.office365.com
user: user@company.com
pass: @/secrets/work_password
# Exclude certain folders
exclude_folders: Junk Email,Deleted Items,Archive
# Optional: disable S3 for this account
# s3_enabled: false
# Optional: disable GPG for this account
# gpg_enabled: false
# Account 3: ProtonMail
- name: secure-proton
server: 127.0.0.1
port: 1143
user: secure@proton.me
pass: env:PROTON_PASSWORD
ssl: false # ProtonMail Bridge uses local unencrypted connection
# Override S3 settings for this account
s3:
bucket: protonmail-backups
prefix: secure
# Use different GPG key
gpg:
recipient: secure-backup@example.com
import_key: /etc/gpg-keys/secure-public.asc
# Account 4: Self-hosted
- name: personal-selfhosted
server: mail.example.com
user: admin@example.com
pass: @/root/.mail_password
# Backup only specific folders
folders: INBOX,Sent,Drafts
# Optional: custom S3 prefix
s3_prefix: selfhosted/admin
# Account 5: Archive account with date-based folders (daily)
- name: archive-gmail
server: imap.gmail.com
user: archive@gmail.com
pass: env:ARCHIVE_PASSWORD
# Enable date-based folders for this account
# Creates: ./backups/archive-gmail/2025-10-10/
# S3 path: backups/archive-gmail/2025-10-10/
use_date_folders: true
# Account 6: Monthly archive with custom date format
- name: monthly-archive
server: imap.example.com
user: monthly@example.com
pass: env:MONTHLY_PASSWORD
# Custom date format for monthly backups
# Creates: ./backups/monthly-archive/2025/10/
use_date_folders: true
date_format: '%Y/%m'
# Account 7: Hourly backups with timestamp
- name: critical-account
server: imap.example.com
user: critical@example.com
pass: env:CRITICAL_PASSWORD
# Include time in backup folder
# Creates: ./backups/critical-account/2025-10-10_14-30/
use_date_folders: true
date_format: '%Y-%m-%d_%H-%M'
# Notes:
# - Each account creates a subdirectory: {basedir}/{account_name}/
# - With date folders enabled: {basedir}/{account_name}/YYYY-MM-DD/
# - S3 prefix becomes: {global_prefix}/{account_name}/ (or custom if specified)
# - With date folders: {global_prefix}/{account_name}/YYYY-MM-DD/
# - If both 'folders' and 'exclude_folders' are set, only 'folders' is used
# - Passwords starting with '@' read from file, 'env:' reads from environment
# - Account settings override global settings
# - Date-based folders are useful for daily backups and historical archives