用于代理邮件通信的网页界面(Lourens、Ace等)。提供收件箱查看、草稿创建/编辑以及通过Gmail/Gog CLI发送功能。
电子邮件 Web 界面 Skill.是一项面向实际任务的技能,主要用于Description. 代理电子邮件通信(Lourens, Ace等)的Web 界面. 提供收件箱查看,草稿创建/编辑,并通过Gmail/Gog C发送功能。它将相关步骤、工具调用和结果整理方式集中到统一流程中,帮助使用者更快完成目标并减少重复操作。
实际使用前应先确认任务范围、数据来源、运行环境、必要权限和关键参数,再依据技能说明逐步执行;若输入条件不完整,应先补齐信息或采用保守配置,避免因错误假设导致结果偏离需求。
执行过程中需要关注工具调用是否成功、接口或依赖是否可用、输出格式是否符合预期,并对异常提示、缺失字段和边界情况进行处理;涉及批量任务时,还应保存进度,避免中断后重复操作。
用于代理邮箱通信(如 Lourens、Ace 等)的网页界面。通过 Gmail/Gog CLI 集成,提供收件箱查看、草稿创建/编辑及邮件发送功能。
Roundcube(推荐)
RainLoop
SnappyMail
构建一个基于 React/Node.js 的自定义界面,具备以下能力:
优先采用 Roundcube,并按需定制。Roundcube 具备以下优势:
# 安装依赖 apt-get update apt-get install -y roundcube roundcube-core roundcube-mysql roundcube-plugins # 或使用 Docker docker run -d --name roundcube -p 8081:80 -e ROUNDCUBEMAIL_DEFAULT_HOST=ssl://imap.gmail.com -e ROUNDCUBEMAIL_DEFAULT_PORT=993 -e ROUNDCUBEMAIL_SMTP_SERVER=tls://smtp.gmail.com -e ROUNDCUBEMAIL_SMTP_PORT=587 roundcube/roundcubemail
Ace 的 Gmail 账户需完成以下配置:
// config/config.inc.php
$config['default_host'] = 'ssl://imap.gmail.com';
$config['default_port'] = 993;
$config['smtp_server'] = 'tls://smtp.gmail.com';
$config['smtp_port'] = 587;
$config['smtp_user'] = 'ace.agent.email@gmail.com';
$config['smtp_pass'] = 'APP_PASSWORD_HERE';
$config['imap_conn_options'] = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
),
);
若 Roundcube 使用体验不佳,可构建自定义界面:
# 使用 Gog CLI 构建的自定义邮件界面
from flask import Flask, render_template, request, jsonify
import subprocess
import json
app = Flask(__name__)
class EmailInterface:
def __init__(self):
self.gog_path = "/usr/local/bin/gog"
def get_inbox(self, limit=50):
"""通过 Gog CLI 获取收件箱邮件。"""
cmd = [self.gog_path, "gmail", "messages", "list",
"--limit", str(limit), "--format", "json"]
try:
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode == 0:
return json.loads(result.stdout)
except Exception as e:
print(f"获取收件箱失败:{e}")
return []
def get_message(self, message_id):
"""获取指定邮件内容。"""
cmd = [self.gog_path, "gmail", "messages", "get",
message_id, "--format", "json"]
try:
result = subprocess.run(cmd, capture_output=True, text=True)
if result.returncode == 0:
return json.loads(result.stdout)
except Exception as e:
print(f"获取邮件失败:{e}")
return None
def send_email(self, to, subject, body):
"""通过 Gog CLI 发送邮件。"""
cmd = [self.gog_path, "gmail", "messages", "send",
"--to", to, "--subject", subject, "--body", body]
try:
result = subprocess.run(cmd, capture_output=True, text=True)
return result.returncode == 0
except Exception as e:
print(f"发送邮件失败:{e}")
return False
@app.route('/')
def inbox():
"""收件箱视图。"""
email_iface = EmailInterface()
messages = email_iface.get_inbox(limit=20)
return render_template('inbox.html', messages=messages)
@app.route('/message/')
def view_message(message_id):
"""查看指定邮件。"""
email_iface = EmailInterface()
message = email_iface.get_message(message_id)
return render_template('message.html', message=message)
@app.route('/compose', methods=['GET', 'POST'])
def compose():
"""撰写新邮件。"""
if request.method == 'POST':
to = request.form['to']
subject = request.form['subject']
body = request.form['body']
email_iface = EmailInterface()
success = email_iface.send_email(to, subject, body)
return jsonify({'success': success})
return render_template('compose.html')
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8082, debug=True)
将邮件界面添加至 Mission Control 侧边栏:
// mission-control 侧边栏配置
{
name: "📧 Ace Email",
path: "/email",
icon: "email",
external: true,
url: "http://localhost:8081" // Roundcube
// 或:"http://localhost:8082" // 自定义界面
}
若 Roundcube 实际运行效果不理想:
相关专题
热门下载
相关下载
精品课程
共6课时 | 54.7万人学习
共89课时 | 134.3万人学习
共49课时 | 82.7万人学习
最新文章