介绍
# ProtonMail Skill
通过 IMAP 使用以下任一方式访问 ProtonMail: - **Proton Bridge**(官方,推荐) - **hydroxide**(第三方,无头)
## 设置
### 选项 1:Proton Bridge (Docker)
```bash # Pull and run docker run -d --name=protonmail-bridge \ -v protonmail:/root \ -p 143:143 -p 1025:25 \ --restart=unless-stopped \ shenxn/protonmail-bridge
# Initial login (interactive) docker run --rm -it -v protonmail:/root shenxn/protonmail-bridge init # Then: login → enter credentials → info (shows bridge password) → exit ```
### 选项 2:hydroxide (Headless)
```bash # Install git clone https://github.com/emersion/hydroxide.git cd hydroxide && go build ./cmd/hydroxide
# Login ./hydroxide auth [email protected]
# Run as service ./hydroxide serve ```
## 配置
在 `~/.config/protonmail-bridge/config.env` 创建配置文件:
```bash PROTONMAIL_HOST=127.0.0.1 PROTONMAIL_PORT=143 [email protected] PROTONMAIL_PASS=your-bridge-password ```
或者直接设置环境变量。
## 用法
```bash # List mailboxes protonmail.py mailboxes
# Show recent inbox protonmail.py inbox --limit 10
# Show unread emails protonmail.py unread
# Search emails protonmail.py search "keyword"
# Read specific email protonmail.py read 123 ```
## 每日扫描
`daily-scan.py` 脚本基于以下条件识别重要邮件: - 重要发件人(银行、政府、学校) - 紧急关键词(DE/EN/NL)
可在脚本中或通过环境变量配置重要模式。
## Sieve 过滤器 (ProtonMail)
推荐用于自动分类的 Sieve 过滤器:
```sieve require ["fileinto", "imap4flags"];
# Important emails - flag them if anyof ( address :contains "From" ["@bank", "@government"], header :contains "Subject" ["Urgent", "Dringend", "Belangrijk"] ) { addflag "\\Flagged"; }
# Newsletters - auto-read and move if anyof ( address :contains "From" "newsletter@", address :contains "From" "noreply@" ) { addflag "\\Seen"; fileinto "Newsletter"; stop; } ```