用gpg加密备份你的gmail帐户。
EncryptedGmailBackup的Python项目详细描述
#加密Gmail备份
将您的配置放入~/。加密的gmail\u备份
示例配置:
[gmail] username = stephen.holiday@gmail.com password = changeme
[gpg] keyid = 76AA7B2CF3FD360E binary = gpg
[backup] path = /backup/gmail/ metafile = gmailmeta.txt archive = messages.tar
[gmail] username = NONE password = NONE server = imap.gmail.com folder = [Gmail]/All Mail
[gpg] # The recipient to encrypt to. keyid = 76AA7B2CF3FD360E binary = gpg home = ~/.gnupg encoding = utf-8
[backup] # Target directory for the backup. Must exist and end in a trailing slash. path = /tmp/
# Name of the target archive. # Appended to the backup path. archive = messages.tar
# Stores the ID of the last fetched message. metafile = gmailmeta.txt
# If your backup directory is on mounted device, # the script can check if the target directory exists first and fail gracefully. onexternal = no
# Ensure only one instance of the script per username. use_pid = yes pid_prefix = /tmp/encrypted_gmail_backup
确保chmod 600~/.加密的gmail备份,这样其他用户就无法读取你的密码。
我的系统上安装了macgpg,因此我将二进制文件更改为:
binary = /usr/local/MacGPG2/bin/gpg2
然后运行gmail backup,它将开始获取您的邮件!
基于andrew jennings的[gmail backup](https://github.com/abjennings/gmail-backup)