Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MailArchiver

📧 Lightweight IMAP email backup tool with resume support.

轻量级 IMAP 邮件备份工具,支持断点续传,将邮件安全存储到本地 SQLite 数据库。

Features

  • Full IMAP Sync - 同步所有文件夹,支持断点续传
  • SQLite Storage - 结构化存储,支持全文搜索
  • Attachment Extraction - 自动提取并保存附件
  • Privacy First - 所有数据本地存储,无云端依赖
  • Resume Support - 中断后自动从断点继续

Quick Start

# Clone
git clone https://github.com/wyyxdgm/mailarchiver.git
cd mailarchiver

# Install
npm install

# Configure
cp config.example.json config.json
# Edit config.json with your IMAP credentials

# Sync inbox
npm run sync:inbox

# Sync all folders
npm run sync:all

Configuration

复制 config.example.jsonconfig.json,填入邮箱信息:

{
  "account": "your@email.com",
  "password": "your_app_password_or_token",
  "host": "imap.example.com",
  "port": 993,
  "tls": true
}

⚠️ 注意: 建议使用应用专用密码,而非登录密码。

Usage

# 列出所有文件夹
npm run list

# 同步收件箱
npm run sync:inbox

# 同步指定文件夹
npm run sync -- --folder "Sent"

# 同步所有文件夹
npm run sync:all

Data Structure

邮件存储在 data/mail.db SQLite 数据库:

表名 说明
folders 邮箱文件夹列表
emails 邮件元数据(主题、发件人、日期、正文等)
attachments 附件信息
sync_state 同步状态(断点续传)

附件文件存储在 data/attachments/{uid}/ 目录。

Privacy & Security

  • 🔒 所有邮件存储在本地 SQLite 数据库
  • 🔒 config.json 已加入 .gitignore,密码不会被提交
  • 🔒 无第三方服务,无数据上传

Tech Stack

License

MIT

About

同步所有远程邮件和附件到本地,支持”断点续传“

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages