微算力 · API 导航与自营网关
API 接入 EN
未登录登录
🔒

加密邮箱自动化管家

Proton Mail · v1.0.0
办公 安全 B 级 作者 christopher-schulze 公开目录收录
1.2k 下载 0 安装 2.7k 收藏 8 浏览

简介

通过 Playwright 浏览器自动化安全登录、读取、发送和管理 ProtonMail 加密邮箱,无需 API 密钥,支持反机器人检测。

原始描述

Manage ProtonMail emails via Playwright browser automation. Login, read, send, and manage your encrypted inbox.

通过你的 Agent 添加

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/proton-mail/
Codex CLI~/.codex/skills/proton-mail/
DeepSeek Harness~/.agents/skills/proton-mail/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

核心用法

ProtonMail 自动化技能基于 Playwright 浏览器引擎,提供完整的端到端邮箱管理能力。用户可通过 Node.js 脚本实现:安全登录(支持环境变量注入凭证)、收件箱邮件列表获取、单封邮件内容读取、新邮件撰写与发送(采用键盘导航确保稳定性),以及安全登出。技术实现依赖 Chromium 浏览器配合反检测参数(--disable-blink-features=AutomationControlled、navigator.webdriver 属性隐藏等)模拟真实用户行为。

显著优点

  1. 零 API 依赖:直接操作 ProtonMail Web UI,绕过官方 API 限制,无需申请开发者权限
  2. 企业级反检测:内置 stealth 配置,通过修改浏览器指纹、禁用自动化特征标识,显著降低被封禁概率
  3. 端到端加密兼容:完整支持 ProtonMail 的加密邮件收发流程,不破坏安全模型
  4. 键盘导航鲁棒性:Compose 功能采用 Tab 键顺序导航,比 DOM 选择器更抗 UI 变更
  5. 会话复用潜力:支持 Cookie 持久化,可实现"登录一次,长期复用"

潜在缺点与局限性

  • 2FA 壁垒:无法自动化处理双因素认证,需人工完成首次登录后导出会话
  • UI 脆弱性:ProtonMail 前端类名可能变更,依赖 CSS 选择器的功能存在失效风险
  • 速率限制风险:高频操作可能触发平台反滥用机制,导致临时封禁
  • 法律与 ToS 冲突:自动化操作可能违反 ProtonMail 服务条款,存在账号受限风险
  • 资源消耗:Playwright + Chromium 组合内存占用较高(通常 200MB+),不适合边缘设备

适合人群

  • 需要批量处理加密邮件的隐私意识用户
  • 开发自动化工作流(如告警邮件自动分类、定时报告发送)的技术团队
  • 希望集成 ProtonMail 到内部系统但无法使用官方 API 的企业
  • 已具备 Node.js/Playwright 基础的技术开发者

常规风险

  • 账号安全:凭证若硬编码存在泄露风险,务必使用环境变量或密钥管理服务
  • 会话劫持:Cookie 持久化文件若未加密存储,可能被恶意利用
  • 合规隐患:欧盟 GDPR 等法规下,自动化处理个人数据需确保合法性基础
  • 供应商对抗:ProtonMail 持续升级反爬虫策略,技术方案可能突然失效

技能正文


name: protonmail description: Manage ProtonMail emails via Playwright browser automation. Login, read, send, and manage your encrypted inbox. homepage: https://proton.me/mail metadata: {"clawdbot":{"emoji":"📧","requires":{"bins":["playwright","node"]},"install":[{"id":"npm","kind":"npm","package":"playwright","bins":["npx playwright"],"label":"Install Playwright (npm)"},{"id":"chromium","kind":"exec","command":"npx playwright install chromium","label":"Install Chromium browser"}]}}

ProtonMail 📨

Your encrypted inbox, automated. Because checking emails manually is so 2010.

What it does

  • Login to any ProtonMail account securely
  • Read emails from your inbox
  • Send new emails with compose functionality
  • Manage your mailbox like a pro

All via Playwright browser automation. No API keys, no IMAP/SMTP headaches - just a real browser doing real browser things.

Why this exists

You have better things to do than clicking through ProtonMail's beautiful (but slow) UI. Let your agent handle it. While you relax. Or code. Or whatever it is you do.

We built this because:

  1. ProtonMail's web UI is... leisurely
  2. Automation is hot
  3. Why click when you can script?

Requirements

The Basics

  • Node.js 18+ (20+ recommended)
  • Playwright 1.40+ (npm install playwright)
  • Chromium browser (npx playwright install chromium)

System Dependencies (Linux)

# Ubuntu/Debian
sudo apt-get update
sudo apt-get install -y libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 libgbm1 libasound2 libpango-1.0-0 libcairo2

# Raspberry Pi / ARM
sudo apt-get install -y chromium-browser

The Secret Sauce (Bot Detection Bypass)

This skill includes enterprise-grade bot detection evasion:

// Launch with stealth args
await chromium.launch({ 
  headless: true,
  args: [
    '--disable-blink-features=AutomationControlled',
    '--no-sandbox',
    '--disable-setuid-sandbox',
    '--disable-dev-shm-usage'
  ]
});

// Hide webdriver property
await page.addInitScript(() => {
  Object.defineProperty(navigator, 'webdriver', { get: () => undefined });
});

This makes Chrome think it's being controlled by a human. Mostly works. ✨

Quick Start

1. Login

const { chromium } = require('playwright');

async function loginProton(email, password) {
  const browser = await chromium.launch({ 
    headless: true,
    args: ['--disable-blink-features=AutomationControlled', '--no-sandbox']
  });
  
  const context = await browser.newContext({
    userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/120.0.0.0 Safari/537.36',
  });
  
  const page = await context.newPage();
  await page.addInitScript(() => {
    Object.defineProperty(navigator, 'webdriver', { get: () => undefined });
  });
  
  await page.goto('https://account.proton.me/login');
  await page.waitForTimeout(2000);
  
  await page.fill('#username', email);
  await page.fill('#password', password);
  await page.click('button[type=submit]');
  await page.waitForTimeout(3000);
  
  return { browser, context, page };
}

2. Check Inbox

await page.goto('https://mail.proton.me/inbox');
await page.waitForTimeout(2000);

const emails = await page.evaluate(() => {
  return Array.from(document.querySelectorAll('.item')).map(e => ({
    subject: e.querySelector('.subject')?.innerText,
    sender: e.querySelector('.sender')?.innerText,
    time: e.querySelector('.time')?.innerText
  }));
});

console.log(emails);

3. Read Email

await page.click('.item:first-child');
await page.waitForTimeout(2000);

const content = await page.evaluate(() => 
  document.querySelector('.message-content')?.innerText
);

4. Send Email (Tested & Working)

// Navigate to compose
await page.goto('https://mail.proton.me/compose');
await page.waitForTimeout(3000);

// Use keyboard navigation (most reliable)
// Tab to recipient field
await page.keyboard.press('Tab');
await page.waitForTimeout(500);

// Type recipient
await page.keyboard.type('recipient@email.com');
await page.waitForTimeout(500);

// Tab to subject
await page.keyboard.press('Tab');
await page.waitForTimeout(500);

// Type subject
await page.keyboard.type('Your subject here');
await page.waitForTimeout(500);

// Tab to body
await page.keyboard.press('Tab');
await page.waitForTimeout(500);

// Type message
await page.keyboard.type('Your message here...');

// Send with Ctrl+Enter
await page.keyboard.press('Control+Enter');
await page.waitForTimeout(3000);

5. Logout (please, it's polite)

await page.click('button[aria-label="Settings"]');
await page.click('text=Sign out');
await browser.close();

Environment Variables

Don't hardcode passwords (seriously, don't):

export PROTON_EMAIL="your@email.com"
export PROTON_PASSWORD="yourpassword"

Then in code:

const email = process.env.PROTON_EMAIL;
const password = process.env.PROTON_PASSWORD;

Complete Example

const { chromium } = require('playwright');

async function main() {
  const email = process.env.PROTON_EMAIL || 'your@email.com';
  const password = process.env.PROTON_PASSWORD || 'yourpassword';
  
  const browser = await chromium.launch({ 
    headless: true,
    args: ['--disable-blink-features=AutomationControlled', '--no-sandbox']
  });
  
  const context = await browser.newContext({
    userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 Chrome/120.0.0.0 Safari/537.36',
  });
  
  const page = await context.newPage();
  await page.addInitScript(() => {
    Object.defineProperty(navigator, 'webdriver', { get: () => undefined });
  });
  
  // Login
  await page.goto('https://account.proton.me/login');
  await page.fill('#username', email);
  await page.fill('#password', password);
  await page.click('button[type=submit]');
  await page.waitForTimeout(5000);
  
  // Go to compose
  await page.goto('https://mail.proton.me/compose');
  await page.waitForTimeout(3000);
  
  // Send email using keyboard navigation (most reliable)
  await page.keyboard.press('Tab');
  await page.keyboard.type('recipient@email.com');
  await page.keyboard.press('Tab');
  await page.keyboard.type('Test Subject');
  await page.keyboard.press('Tab');
  await page.keyboard.type('Hello! This is a test email.');
  await page.keyboard.press('Control+Enter');
  
  await page.waitForTimeout(3000);
  console.log('📧 Email sent!');
  
  await browser.close();
}

main();

Limitations

  • 2FA: Can't do 2FA via automation (use a browser on your device for initial login, then cookie session)
  • Rate limiting: ProtonMail might throttle you if you go crazy
  • Dynamic UI: Class names change. Use text selectors or ARIA when possible
  • Headless detection: Works mostly, but Proton might occasionally notice

Troubleshooting

"chromium not found"

npx playwright install chromium

Bot detection / Login fails

  • Verify bot detection bypass is enabled
  • Check user agent string is current
  • Try headed mode for testing

Timeout errors

  • Increase waitForTimeout values
  • Check your internet
  • ProtonMail might be rate limiting

"libX11 not found"

Install system dependencies (see Requirements section)

Security Notes

  • 🔒 Credentials should come from environment variables, not hardcoded
  • 🔑 Use app-specific passwords if ProtonMail supports them
  • 📝 Always logout when done
  • 🍪 Session cookies can be saved for re-use (advanced)

Made with 🦞🔒

From Claws for Claws. Because reading emails manually is for plebs.

HQ Quality Approved.

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

emailprivacyautomationbrowser-automationprotonmailplaywrightencryption

同类 Skill