中风险
示例过滤器会将匹配邮件移出收件箱,超出所述的标签、加星或分类行为
原文依据:2 处发现了什么
过滤器操作不仅添加标签,还删除 `INBOX` 标签,也就是自动归档来自匹配发件人的新邮件。技能简介没有说明这一步会让邮件离开收件箱。
为什么需要注意
用户可能看不到收件箱中的收据、付款通知或其他重要邮件,从而错过退款期限、付款异常或需要处理的通知。邮件通常仍保留在账户中,但可见性会降低。
技能声明的用途是给来信加标签、加星或分类,但实际创建过滤器的命令同时把 `INBOX` 加入 `removeLabelIds`。用户若直接采用该示例,来自 `receipts@example.com` 的匹配邮件会被移除收件箱(归档),可能降低可见性并导致漏看。用户可要求作者明确披露归档行为,并在不希望归档时限制操作不得移除 `INBOX`。
name: recipe-create-gmail-filterdescription: "Create a Gmail filter to automatically label, star, or categorize incoming messages."metadata:查看另外 1 个位置
2. Create a new label: `gws gmail users labels create --params '{"userId": "me"}' --json '{"name": "Receipts"}'`3. Create a filter: `gws gmail users settings filters create --params '{"userId": "me"}' --json '{"criteria": {"from": "receipts@example.com"}, "action": {"addLabelIds": ["LABEL_ID"], "removeLabelIds": ["INBOX"]}}'`4. Verify filter: `gws gmail users settings filters list --params '{"userId": "me"}' --format table`