防护思路
点击放大

A secure, containerized Model Context Protocol (MCP) server that integrates SpamAssassin for defensi security analysis. This ser Claude Code with comprehensi analysis capabilities while maintaining strict security boundaries.
![License: MIT]()
![Go ]()
![Docker]()

Defensi Only - This ser provides security analysis capabilities:
#### scan_email
Analyze email content for spam probability and rule matches.
Parameters:
content (required): Raw email content including headersheaders (optional): Additional headers to analyzecheck_bayes (optional): Include Bayesian analysis (optional): Return detailed rule explanationsExample:
#### check_reputation
Check sender reputation and domain/IP blacklists.
Parameters:
sender (required): Email sender addressdomain (optional): Sender domainip (optional): Sender IP address#### explain_score
Explain how a spam score was calculated with detailed breakdown.
#### get_config
Retrie SpamAssassin configuration and status.
#### update_rules
Update SpamAssassin rule definitions (defensi only).
Parameters:
source (optional): Rule source (official/custom)force (optional): Force update even if recent#### test_rules
Test custom rules against sample emails in a safe en.
Parameters:
rules (required): Custom rule definitionstest_emails (required): Array of sample emails to test| | Default | Description |
|----------|---------|-------------|
| SA_MCP_HOST_PORT | 8081 | Host port for container deployment |
| SA_MCP_LOG_LEVEL | info | Logging level (debug, info, warn, error) |
| SA_MCP_SER | 0.0.0.0:8080 | Server bind address (container internal) |
| SA_MCP_SPAMASSASSIN_HOST | localhost | SpamAssassin daemon host |
| SA_MCP_SPAMASSASSIN_PORT | 783 | SpamAssassin daemon port |
| SA_MCP_SPAMASSASSIN_THRESHOLD | 5.0 | Spam score threshold |
| SA_MCP_SECURITY_MAX_EMAIL_SIZE | 10485760 | Max email size (10MB) |
| UPDATE_RULES | false | Update SpamAssassin rules on startup |
| MCP_TRANSPORT | auto | Transport mode (auto, stdio, sse) |
The ser comprehensi measures:
spamassassin)#### Container Restart Loop
Symptoms: Container continuously restarts with "read error: EOF"
#### Port Conflicts
Symptoms: "bind: address already in use"
SA_MCP_HOST_PORT in .env file#### Network Subnet Conflicts
Symptoms: "Pool o with other one on this address space"
#### Health Check Failures
Symptoms: Container marked unhealthy
/usr/local/bin/health-check.sh manuallydocker compose logs spamassassin-mcpMIT License - See LICENSE file for details.
This project uses GitHub Actions for continuous integration and deployment:
1. Docker Build and Push: Automatically builds and pushes Docker images to Docker Hub on pushes to main branch and tags
2. Test Docker Image: Runs tests on the Docker image to ensure it builds and runs correctly
3. Update Docker Hub O: Automatically updates the Docker Hub repository description when README.md changes
To use the Docker Hub publishing workflow:
1. Create a Docker Hub account if you don't already have one
2. Generate a Docker Hub access token:
- Log in to Docker Hub
- Go to Account Settings > Security
- Click "New Access Token"
- Give it a descriptive name (e.g., "GitHub Actions")
- Set permissions to "Read & Write"
- Copy the generated token (you won't see it again)
3. Set up Docker Hub credentials as GitHub Secrets:
- Go to your GitHub repository settings
- Click "Secrets and " > "Actions"
- Add two new repository secrets:
- DOCKER_USERNAME: Your Docker Hub username
- DOCKER_PASSWORD: Your Docker Hub access token (the token you just created)
4. Push to the main branch or create a tag starting with v (e.g., v1.0.0)
- The workflow will automatically build and push the image to Docker Hub
The published images will be a at where YOUR_USERNAME is your Docker Hub username.
Image tags:
latest - Latest build from the main branchvX.Y.Z - Specific tags for releasescommit-SHA - Specific commit buildsYou can also manually generate the Docker Hub o:
Contributions welcome! Please read our Contributing Guide and ensure all changes maintain the security-first, defensi design principles.
For issues and questions:
1. First Steps: Check the Troubleshooting Guide
2. Logs: docker-compose logs spamassassin-mcp
3. Health Check: docker-compose exec spamassassin-mcp /usr/local/bin/health-check.sh
4. SpamAssassin Status: docker-compose exec spamassassin-mcp pgrep spamd
---
⚠️ Security Notice: This server is designed exclusively for defensi analysis. It does not provide capabilities for sending emails, generating spam content, or any offensi operations. All operations are logged and auditable.
开发语言:Go
Star 数:6
该项目属于防护思路方向的开源资源,代码结构清晰,适合安全研究人员学习参考。项目围绕A secure, containerized Model Context Protocol (MCP) server that integrates SpamAssassin for defensive email security analysis. This server provides Claude Code with comprehensive email analysis capabilities while maintaining strict security boundaries.展开,提供了可运行的实现,对理解相关安全机制、工具原理与攻防技术具有较高的研究价值。
从技术实现角度看,此类项目的核心在于对底层原理的深入理解与工程化落地。开发者在研究过程中可以结合官方文档与社区讨论,梳理项目的初始化流程、核心模块职责与数据流转,逐步掌握其中的技术细节与设计思路。
1. 下载源码压缩包,解压到本地环境。
2. 根据项目类型准备对应的运行环境与依赖。
3. 按照 README 中的步骤完成配置与部署。
4. 在隔离的测试环境中运行验证,避免影响生产系统。
本资源来源于开源社区,仅供安全研究、技术学习与合法授权范围内的攻防演练使用,请勿用于任何非法或侵害他人权益的用途。使用本项目产生的一切后果由使用者自行承担。
| 资源标题 | spamassassin-mcp - A secure, containerized Model Context Protocol (MC |
| 所属分类 | 防护思路 |
| 发布作者 | admin |
| 发布时间 | 2026-10-06 00:14:02 |
| 下载权限 | 免费下载 |
| 附件数量 | 2 个下载链接 |
| 浏览次数 | 204 |
| 讨论数量 | 0 |
| 主题状态 | 正常讨论中 |