Skip to content
Back to skills

M365 Spam Manager

ASecurity

"Microsoft 365 spam folder manager for Outlook/Exchange mailboxes.

  • 21 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 7, 2026
ai-agentsbashnodegitsecurity

Security analysis

A92/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 9 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill m365-spam-manager --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of M365 Spam Manager?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for M365 Spam Manager
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-m365-spam-manager/badge)](https://www.skillsdirectory.com/skills/modbender-m365-spam-manager)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: m365-spam-manager
description: "Microsoft 365 spam folder manager for Outlook/Exchange mailboxes.
  Automatically analyzes junk/spam emails, calculates a suspicious score based
  on structural patterns (missing unsubscribe links, poor language, suspicious
  domains, wrong character sets, etc.), and helps clean up the junk folder.
  Supports review mode (default) where user approves each action, and automatic
  mode for batch processing. Works with shared mailboxes via --mailbox flag.
  Related keywords: Outlook, Exchange Online, spam filter, junk email, phishing,
  email security. **Token cost:** ~500-1.5k tokens per use."
---


# M365 Spam Manager (Microsoft Graph)

## Installation

Requires Node.js + npm install in the skill folder:
```bash
cd skills/m365-spam-manager
npm install
```

## Setup

Uses the same profile/credentials as `m365-mailbox`. Ensure you have a profile configured:
```bash
node skills/m365-mailbox/scripts/setup.mjs --profile tom-business ...
```

## Usage

### Review mode (default) — user must approve each action

```bash
# Analyze junk folder and show suspicious scores (review mode - default)
node skills/m365-spam-manager/scripts/analyze.mjs --profile tom-business-mail --mailbox radman@e-ola.com

# Move a false positive to inbox (requires confirmation)
node skills/m365-spam-manager/scripts/move-to-inbox.mjs --profile tom-business-mail --mailbox radman@e-ola.com --id <MSG_ID>

# Move confirmed spam to learning folder
node skills/m365-spam-manager/scripts/move-to-learning.mjs --profile tom-business-mail --mailbox radman@e-ola.com --id <MSG_ID>
```

### Automatic mode (no confirmation)

```bash
# Auto-clean: move high-confidence spam to learning, medium to review
node skills/m365-spam-manager/scripts/auto-clean.mjs --profile tom-business-mail --mailbox radman@e-ola.com --threshold 80
```

## 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)
- `move`: controlled (move to inbox/learning folder)

In review mode, the script always prompts for confirmation before moving emails.

Files in this skill

  • SKILL.md3 KB
  • package-lock.json7.1 KB
  • package.json268 B
  • scripts/_graph.mjs2.2 KB
  • scripts/_lib.mjs1 KB
  • scripts/analyze.mjs5.6 KB
  • scripts/check-spam.mjs5.2 KB
  • scripts/move-to-inbox.mjs1.1 KB
  • scripts/move-to-learning.mjs1.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.