用途:porteden email(别名 porteden mail)用于跨多个账户管理电子邮件,覆盖 Gmail、Outlook 与 Exchange,适合在命令行或自动化流程中批量处理邮件。
主要能力:可列出、过滤、搜索、读取单封邮件与整个会话线程,也能发送、回复、转发、删除和修改邮件(标记已读/未读、添加或移除标签)。过滤支持按发件人、收件人、主题、标签、未读、附件等条件,并可限定今天、昨天、本周或自定义日期范围。
使用方式:未安装时用 brew install porteden/tap/porteden 或 go install github.com/porteden/cli/cmd/porteden@latest。首次需认证,推荐浏览器登录 porteden auth login,也可用 porteden auth login --token <key>,再用 porteden auth status 验证;若环境已设置 PE_API_KEY 则自动使用。常用命令如 porteden email messages -jc 列出邮件,-q "keyword" 搜索,--week --all 自动翻页;发送用 porteden email send --to user@example.com --subject "Hi" --body "Hello",回复用 porteden email reply <emailId> --body "Thanks",转发用 porteden email forward <emailId> --to colleague@example.com。
输出与配置:-jc 是 --json --compact 简写,会精简附件信息、正文预览和标签以减少 token;--all 自动获取所有分页,可检查 hasMore 与 nextPageToken。邮件 ID 带提供商前缀(如 google:abc123、m365:xyz789),需原样传入。--include-body 可获取完整正文,单封邮件默认包含正文。--body 与 --body-file 互斥,--body-type text 表示纯文本,默认 html。可用 PE_PROFILE、PE_TIMEZONE、PE_FORMAT 等环境变量调整行为。
限制与注意:发送、回复、转发或删除前应先确认;凭据登录后保存在系统钥匙串中,无需重复认证。其余细节暂未提供。