M365 Spam Manager (Microsoft Graph)
Installation
Requires Node.js + npm install in the skill folder:
CODEBLOCK0
Setup
Uses the same profile/credentials as m365-mailbox. Ensure you have a profile configured:
CODEBLOCK1
Usage
Review mode (default) — user must approve each action
CODEBLOCK2
Automatic mode (no confirmation)
CODEBLOCK3
Suspicious Score Calculation
The analyzer calculates a score (0-100) based on:
| Pattern | Points | Description |
|---|
| No unsubscribe link | +20 | Legitimate marketing must have one |
| Suspicious sender domain |
+15 | Free email, misspellings, random strings |
| All caps subject | +10 | Spam often shouts |
| Excessive punctuation | +10 | !!!, ???, $$$ |
| Suspicious keywords | +15 | crypto, win, free, urgent, verify, bank, password, ... |
| Mismatched language | +10 | Subject in DE, body EN or vice versa |
| Known scam patterns | +25 | "Attention - suspected SPAM", fake invoices |
| Free email provider | +10 | gmail, yahoo, hotmail in From (not Reply-To) |
| No DKIM/SPF indication | +5 | Graph doesn't show auth results |
Score thresholds
- - 0-30: Low suspicion — likely legitimate
- 31-70: Medium — review recommended
- 71-100: High — almost certainly spam
Policy
This skill respects the same policy as m365-mailbox:
- -
read: autonomous (analyze, list) - INLINECODE3 : controlled (move to inbox/learning folder)
In review mode, the script always prompts for confirmation before moving emails.
M365 垃圾邮件管理器 (Microsoft Graph)
安装
需要在技能文件夹中安装 Node.js 和 npm:
bash
cd skills/m365-spam-manager
npm install
设置
使用与 m365-mailbox 相同的配置文件/凭证。请确保已配置配置文件:
bash
node skills/m365-mailbox/scripts/setup.mjs --profile tom-business ...
使用方法
审核模式(默认)— 用户必须批准每个操作
bash
分析垃圾邮件文件夹并显示可疑评分(审核模式 - 默认)
node skills/m365-spam-manager/scripts/analyze.mjs --profile tom-business-mail --mailbox radman@e-ola.com
将误报邮件移至收件箱(需要确认)
node skills/m365-spam-manager/scripts/move-to-inbox.mjs --profile tom-business-mail --mailbox radman@e-ola.com --id
将确认的垃圾邮件移至学习文件夹
node skills/m365-spam-manager/scripts/move-to-learning.mjs --profile tom-business-mail --mailbox radman@e-ola.com --id
自动模式(无需确认)
bash
自动清理:将高置信度垃圾邮件移至学习文件夹,中等置信度邮件移至审核文件夹
node skills/m365-spam-manager/scripts/auto-clean.mjs --profile tom-business-mail --mailbox radman@e-ola.com --threshold 80
可疑评分计算
分析器根据以下模式计算评分(0-100):
| 模式 | 分值 | 描述 |
|---|
| 无退订链接 | +20 | 合法营销邮件必须包含退订链接 |
| 可疑发件人域名 |
+15 | 免费邮箱、拼写错误、随机字符串 |
| 全大写主题 | +10 | 垃圾邮件常用全大写 |
| 过多标点符号 | +10 | !!!、???、$$$ |
| 可疑关键词 | +15 | 加密货币、中奖、免费、紧急、验证、银行、密码等 |
| 语言不匹配 | +10 | 主题为德语,正文为英语,反之亦然 |
| 已知诈骗模式 | +25 | 注意 - 疑似垃圾邮件、虚假发票 |
| 免费邮箱提供商 | +10 | 发件人地址为gmail、yahoo、hotmail(非回复地址) |
| 无DKIM/SPF标识 | +5 | Graph未显示认证结果 |
评分阈值
- - 0-30:低可疑度 — 可能为合法邮件
- 31-70:中等可疑度 — 建议审核
- 71-100:高可疑度 — 几乎确定为垃圾邮件
策略
本技能遵循与 m365-mailbox 相同的策略:
- - read:自主(分析、列出)
- move:受控(移至收件箱/学习文件夹)
在审核模式下,脚本在移动邮件前始终会提示确认。