从零开始部署 Email AI Assistant
- Windows 10/11 或 Windows Server
- Python 3.8+
- 网络连接(用于收发邮件)
- 访问 https://www.python.org/downloads/
- 下载 Python 3.11 或更高版本
- 运行时勾选
Add Python to PATH
winget install Python.Python.3.11python --versiongit clone https://github.com/Thatgfsj/claude-email-cli.git
cd claude-email-cli或者直接下载 ZIP:
- 访问 https://github.com/Thatgfsj/claude-email-cli
- 点击 Code → Download ZIP
- 解压到目录
pip install -r requirements.txt注意:如果使用 Web 界面,Flask 已在 requirements.txt 中。
python init_setup.py按提示输入:
- 邮箱地址
- 授权码/密码
- IMAP/SMTP 服务器地址
- 发件人白名单
- 复制配置示例:
copy config.example.json config.json- 编辑
config.json:
{
"imap_host": "imap.qq.com",
"imap_port": 993,
"smtp_host": "smtp.qq.com",
"smtp_port": 465,
"email": "your@qq.com",
"password": "your_auth_code",
"allowed_senders": ["your@qq.com"],
"claude_path": "claude",
"poll_interval": 30,
"timeout": 300
}set EMAIL_USER=your@qq.com
set EMAIL_PWD=your_auth_code
set IMAP_HOST=imap.qq.com
set SMTP_HOST=smtp.qq.com
set ALLOWED_SENDERS=your@qq.com确保本地已安装 Claude CLI:
claude --version如果没有,请访问 https://github.com/anthropics/claude-code
python run.pypython run_web.py然后浏览器访问 http://localhost:5000
A:
- 检查邮箱是否开启了 SMTP/IMAP
- QQ 邮箱需要使用"授权码"而非登录密码
- 检查防火墙是否阻止了端口 465/993
A:
- 确认 Claude CLI 已安装并在 PATH 中
- 尝试手动运行
claude --help
A: 使用 Windows 任务计划程序或 start /b python run.py
A:
- 创建快捷方式到启动文件夹
- 或使用任务计划程序
如果遇到连接问题,检查:
netsh advfirewall firewall add rule name="Python Email AI" dir=in action=allow program="C:\Python311\python.exe"# 1. 安装 Python
winget install Python.Python.3.11
# 2. 克隆项目
git clone https://github.com/Thatgfsj/claude-email-cli.git
cd claude-email-cli
# 3. 安装依赖
pip install -r requirements.txt
# 4. 配置(手动编辑 config.json)
notepad config.json
# 5. 启动
python run.py