PHPackages                             texxasrulez/rc\_shield - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Security](/categories/security)
4. /
5. texxasrulez/rc\_shield

ActiveRoundcube-plugin[Security](/categories/security)

texxasrulez/rc\_shield
======================

RoundcubeShield security analysis plugin for Roundcube

1.0.0(1mo ago)16GPL-3.0-onlyPHPPHP &gt;=8.0

Since Apr 2Pushed 1mo agoCompare

[ Source](https://github.com/texxasrulez/rc_shield)[ Packagist](https://packagist.org/packages/texxasrulez/rc_shield)[ Docs](https://github.com/texxasrulez/rc_shield)[ RSS](/packages/texxasrulez-rc-shield/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

RoundcubeShield
===============

[](#roundcubeshield)

[![Downloads](https://camo.githubusercontent.com/c842e2d072abbba1233eefaf18b68f3e4e90537a988ff5fe5e781d3f9a38f6dc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f74657878617372756c657a2f72635f736869656c642f746f74616c3f7374796c653d706c6173746963266c6f676f3d676974687562266c6f676f436f6c6f723d7768697465266c6162656c3d446f776e6c6f616473266c6162656c436f6c6f723d6171756126636f6c6f723d626c7565)](https://camo.githubusercontent.com/c842e2d072abbba1233eefaf18b68f3e4e90537a988ff5fe5e781d3f9a38f6dc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f646f776e6c6f6164732f74657878617372756c657a2f72635f736869656c642f746f74616c3f7374796c653d706c6173746963266c6f676f3d676974687562266c6f676f436f6c6f723d7768697465266c6162656c3d446f776e6c6f616473266c6162656c436f6c6f723d6171756126636f6c6f723d626c7565)[![Packagist Downloads](https://camo.githubusercontent.com/1647de5ffc706d3e3124b74bfc11eeac8ad6b974e59f0eaab652b2e26b05f0c6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f74657878617372756c657a2f72635f736869656c643f7374796c653d706c6173746963266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465266c6162656c3d446f776e6c6f616473266c6162656c436f6c6f723d626c756526636f6c6f723d676f6c64)](https://packagist.org/packages/texxasrulez/rc_shield)[![Packagist Version](https://camo.githubusercontent.com/84fee5aada8a693fa1ce74ef272fa8e375853f86e0d63ffafa3ea4f8e7c8ddd8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f74657878617372756c657a2f72635f736869656c643f7374796c653d706c6173746963266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465266c6162656c3d56657273696f6e266c6162656c436f6c6f723d626c756526636f6c6f723d6c696d65677265656e)](https://packagist.org/packages/texxasrulez/rc_shield)[![Github License](https://camo.githubusercontent.com/9c5513fe900bbacb48476e3e46b068cd499762655b4bd3bdad2968f9619cfb1d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f74657878617372756c657a2f72635f736869656c643f7374796c653d706c6173746963266c6f676f3d676974687562266c6162656c3d4c6963656e7365266c6162656c436f6c6f723d626c756526636f6c6f723d636f72616c)](https://github.com/texxasrulez/rc_shield/LICENSE)[![GitHub Stars](https://camo.githubusercontent.com/6fde21fe8ba492f1e587594961b22ef4da093437716f4c78405fe4c59eb28e21/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f74657878617372756c657a2f72635f736869656c643f7374796c653d706c6173746963266c6f676f3d676974687562266c6162656c3d5374617273266c6162656c436f6c6f723d626c756526636f6c6f723d64656570736b79626c7565)](https://github.com/texxasrulez/rc_shield/stargazers)[![GitHub Issues](https://camo.githubusercontent.com/e76c3023f1537bc89658119316a72ec686b5d1a3ddf5a385fc34ad1d0022a53c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f74657878617372756c657a2f72635f736869656c643f7374796c653d706c6173746963266c6f676f3d676974687562266c6162656c3d497373756573266c6162656c436f6c6f723d626c756526636f6c6f723d61717561)](https://github.com/texxasrulez/rc_shield/issues)[![GitHub Contributors](https://camo.githubusercontent.com/7b1ab7efe8cbc8b5cd19dc963acab205365f6c80c0e5f795638b64c007dcf9db/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f74657878617372756c657a2f72635f736869656c643f7374796c653d706c6173746963266c6f676f3d676974687562266c6f676f436f6c6f723d7768697465266c6162656c3d436f6e7472696275746f7273266c6162656c436f6c6f723d626c756526636f6c6f723d6f7263686964)](https://github.com/texxasrulez/rc_shield/graphs/contributors)[![GitHub Forks](https://camo.githubusercontent.com/f80df03f701a338ebd405207b2a18c400002e1d1734c243bfd64f92557854fff/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f74657878617372756c657a2f72635f736869656c643f7374796c653d706c6173746963266c6f676f3d676974687562266c6f676f436f6c6f723d7768697465266c6162656c3d466f726b73266c6162656c436f6c6f723d626c756526636f6c6f723d6461726b6f72616e6765)](https://github.com/texxasrulez/rc_shield/forks)[![Donate Paypal](https://camo.githubusercontent.com/02124075ee7ea4c192ef867cb30577b0b43ba74ea42b8dbe20b56ef518d94cdb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50617970616c2d4d6f6e65795f506c65617365212d626c75652e7376673f7374796c653d706c6173746963266c6162656c436f6c6f723d626c756526636f6c6f723d666f72657374677265656e266c6f676f3d70617970616c)](https://www.paypal.me/texxasrulez)

RoundcubeShield is a production-oriented Roundcube plugin that analyzes real message headers, authentication results, sender identity mismatches, origin routing hints, and optional reputation data to produce a weighted threat score. It adds asynchronous mailbox threat indicators and a message-view analysis panel without blocking mail rendering.

Features
--------

[](#features)

- Real Roundcube plugin integration through `rcube_plugin`, hooks, and registered plugin actions.
- Async mailbox threat icons with `Safe`, `Suspicious`, `Dangerous`, and `Unknown` states.
- Message analysis panel with threat score, threat meter, authentication results, sender/domain mismatch details, origin IP, reverse DNS, geolocation summary, reputation status, reasons, and technical details.
- Header parsing for `Authentication-Results`, `Received`, `DKIM-Signature`, `Return-Path`, `Reply-To`, `From`, `Message-ID`, and selected `X-*` headers.
- Weighted scoring engine with configurable thresholds and rule weights.
- Provider architecture for local intelligence, DNSBL, and explicitly allowlisted external HTTP adapters.
- Database-backed caching for analysis and reputation lookups.
- Optional admin cache purge endpoint.
- User preferences for mailbox icons, tooltips, and compact vs detailed panel display.

**Screenshot**
--------------

[](#screenshot)

[![Alt text](images/screenshot.png?raw=true "RoundcubeShield Screenshot")](images/screenshot.png?raw=true)

Supported Skins
---------------

[](#supported-skins)

- `elastic`
- `classic`
- `larry`
- `autumn_larry`
- `black_larry`
- `blue_larry`
- `green_larry`
- `grey_larry`
- `pink_larry`
- `plata_larry`
- `summer_larry`
- `teal_larry`
- `violet_larry`

Larry color variants reuse the base `larry` skin assets and only ship minimal wrapper styles.

Installation
------------

[](#installation)

1. Install the plugin with Composer or copy `plugins/rc_shield` into the Roundcube plugin directory.
2. If you install through Composer with `roundcube/plugin-installer`, the schema in `plugins/rc_shield/SQL/` can be discovered automatically. For manual installs, apply the `*.initial.sql` schema matching your Roundcube database engine.
3. Add `rc_shield` to `config/config.inc.php` in the Roundcube plugins array.
4. Copy `plugins/rc_shield/config.inc.php.dist` to `plugins/rc_shield/config.inc.php` and adjust site-specific settings.
5. Clear Roundcube caches and reload the mail UI.

Configuration
-------------

[](#configuration)

Core configuration lives in `config.inc.php`:

```
$config['rcs_enable_geo'] = true;
$config['rcs_enable_dns'] = true;
$config['rcs_enable_external_reputation'] = false;
$config['rcs_cache_ttl_analysis'] = 86400;
$config['rcs_cache_ttl_reputation'] = 43200;
$config['rcs_score_threshold_safe_max'] = 30;
$config['rcs_score_threshold_suspicious_max'] = 70;
$config['rcs_weight_spf_fail'] = 30;
$config['rcs_weight_dkim_fail'] = 25;
$config['rcs_weight_dmarc_fail'] = 25;
$config['rcs_weight_replyto_mismatch'] = 20;
```

Important security-related config:

- `rcs_allowed_http_hosts`: allowlist of external reputation service hosts.
- `rcs_http_providers`: static provider adapter definitions.
- `rcs_allowlisted_domains`, `rcs_allowlisted_emails`, `rcs_allowlisted_ip_ranges`.
- `rcs_blocklisted_domains`, `rcs_blocklisted_ips`.
- `rcs_trusted_mta_networks`.
- `rcs_admin_user_ids`.
- `rcs_debug`.

Provider Architecture
---------------------

[](#provider-architecture)

RoundcubeShield separates analysis from enrichment:

- `rcs_provider_local`: local allowlist/blocklist logic, reverse DNS, reserved/private IP detection, and basic geo placeholder behavior.
- `rcs_provider_dnsbl`: DNSBL-style reputation checks using configured zones.
- `rcs_provider_generic_http`: optional HTTPS JSON adapter with strict host allowlisting.

External provider calls are optional. If disabled or unavailable, analysis still completes from local header evidence.

Scoring Model
-------------

[](#scoring-model)

Scoring is additive and configurable. Default thresholds:

- `0-30`: Safe
- `31-70`: Suspicious
- `71+`: Dangerous

Current default rule categories include:

- SPF fail, softfail, or none.
- DKIM fail or none.
- DMARC fail or none.
- From vs Reply-To mismatch.
- From vs Return-Path mismatch.
- Suspicious HELO.
- Missing reverse DNS.
- Reputation blocklist hit.
- Private/reserved origin IP.
- Malformed or missing critical headers.
- Trusted sender deduction.
- Trusted network deduction.

All rules emit machine-readable reason codes and human-readable messages.

Cache Behavior
--------------

[](#cache-behavior)

`rcs_cache` stores JSON payloads keyed by:

- cache scope
- mailbox
- UID
- message identity hash
- analysis version salt

Cache scopes used now:

- `analysis`
- `reputation`
- `headers`

Analysis is invalidated automatically when the message identity hash changes or when `rcs_analysis_version` changes.

Security Model
--------------

[](#security-model)

- Every AJAX endpoint validates the Roundcube request token.
- Mailbox names and UIDs are normalized and bounded before use.
- Only Roundcube plugin actions are used; there are no direct-access PHP endpoints.
- UI output is escaped before client-side rendering and sanitized through fixed server response shapes.
- External HTTP lookups are disabled by default.
- External HTTP providers require explicit HTTPS URLs and explicit host allowlisting.
- No shell execution, dynamic routing files, eval, or unsafe deserialization are used.
- Provider failures, parsing gaps, and cache misses fail gracefully and return `Unknown` or partial analysis instead of breaking mail views.

Performance Notes
-----------------

[](#performance-notes)

- Mailbox pages do not perform synchronous remote analysis during initial HTML render.
- The mailbox view only analyzes visible message UIDs received from the real `messages_list` hook.
- Bulk mailbox status requests are batched through one plugin action.
- Analysis and reputation data are cached aggressively.
- Message detail panels lazy-load after the Roundcube page initializes.

Integration Map
---------------

[](#integration-map)

### Hooks

[](#hooks)

- `add_hook('storage_init', ...)`Ensures relevant headers are fetched by Roundcube storage.
- `add_hook('messages_list', ...)`Captures real visible message UIDs from the active mailbox page and exposes them to mailbox JS.
- `add_hook('message_load', ...)`Captures the active message UID and mailbox from the real Roundcube message object.
- `add_hook('message_headers_output', ...)`Injects a real message-view placeholder into the message headers area.
- `add_hook('template_object_messagesummary', ...)`Appends the analysis placeholder to message summary content when needed across skins.
- `add_hook('render_page', ...)`Loads JS/CSS only for the mail task and exports runtime URLs, icons, strings, token, mailbox, and UID.
- `add_hook('preferences_sections_list', ...)`Adds a Roundcube settings section for presentation preferences.
- `add_hook('preferences_list', ...)`Renders safe user-facing preferences.
- `add_hook('preferences_save', ...)`Validates and stores user-facing preferences.

### Actions

[](#actions)

- `register_action('plugin.rc_shield.statuses', ...)`Returns bulk mailbox threat states for visible UIDs.
- `register_action('plugin.rc_shield.analysis', ...)`Returns detailed message analysis JSON for a specific UID and mailbox.
- `register_action('plugin.rc_shield.cache_purge', ...)`Purges plugin caches for configured admin users.

### Asset Loading

[](#asset-loading)

- `styles/variables.css`: mail task, all supported skins.
- `styles/common.css`: mail task, all supported skins.
- `skins//styles/rc_shield.css`: mail task, selected skin wrapper.
- `js/rc_shield.js`: mail task, provides shared namespace, fetch helper, and message panel loader.
- `js/rc_shield_mailbox.js`: mail task, mailbox icon placeholder insertion and batched status fetch.

### Runtime Data Flow

[](#runtime-data-flow)

- Mailbox view gets real message UIDs from `messages_list`, not from fake demo rows.
- Mailbox JS reads those UIDs, inserts an `Unknown` placeholder icon, and requests statuses from `plugin.rc_shield.statuses`.
- Message analysis reads real message context through `rcube_message` and Roundcube storage methods such as `get_raw_message()` or `get_raw_headers()` when available.
- Parser, reputation providers, scoring, and cache operate entirely in the plugin runtime path.
- Optional provider adapters are extension points; core parsing and scoring remain local runtime logic.

Security Notes
--------------

[](#security-notes)

### Input Validation Strategy

[](#input-validation-strategy)

- UIDs are converted to positive integers only.
- Mailbox names are stripped of control characters and length-bounded.
- Batch UID lists are deduplicated and size-limited.
- Request tokens are required for every JSON action.

### Output Escaping Strategy

[](#output-escaping-strategy)

- Server-generated HTML placeholders are built from fixed plugin strings.
- Client rendering escapes dynamic text before DOM insertion.
- JSON responses expose only structured analysis fields required by the UI.

### SSRF Protections

[](#ssrf-protections)

- Generic HTTP providers are disabled by default.
- Only HTTPS endpoints are accepted.
- Provider hosts must match `rcs_allowed_http_hosts`.
- URLs come only from static admin configuration, never from user input.
- Redirects are disabled for external HTTP lookups.

### Permission Boundaries

[](#permission-boundaries)

- Endpoints run within the authenticated Roundcube session.
- Cache purge is limited to configured admin user IDs.
- User preferences cover presentation only, not provider or risk model settings.

### Failure Behavior

[](#failure-behavior)

- Parsing failures add warnings and degrade to partial analysis.
- Provider exceptions are caught and isolated.
- Unavailable analysis returns `Unknown` or a non-fatal error panel.
- Mailbox rendering does not block on provider latency.

Future Extension Points
-----------------------

[](#future-extension-points)

- Additional provider adapters implementing `rcs_provider_interface`.
- Site-specific webhook intelligence adapters.
- Extra scoring rules inside `rcs_scoring`.
- More advanced geolocation providers.
- Policy-aware trusted sender models.

Screenshots
-----------

[](#screenshots)

- Mailbox threat icons: placeholder
- Message analysis panel: placeholder
- Settings section: placeholder

Upgrade Notes
-------------

[](#upgrade-notes)

- Composer-based installs can apply versioned schema updates from `SQL//`.
- Manual installs must apply the matching schema migration when moving between plugin versions that alter `rcs_cache`.
- Bump `rcs_analysis_version` to invalidate old cached analysis after changing scoring or parsing behavior.
- Review `rcs_allowed_http_hosts` and `rcs_http_providers` carefully before enabling external reputation.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance91

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~15 days

Total

2

Last Release

53d ago

Major Versions

0.0.1 → 1.0.02026-04-17

### Community

Maintainers

![](https://www.gravatar.com/avatar/95c3af6e41a9786e8be2edb48176e43a7d1ddef429793a312168450ff4269deb?d=identicon)[texxasrulez](/maintainers/texxasrulez)

---

Top Contributors

[![texxasrulez](https://avatars.githubusercontent.com/u/10519182?v=4)](https://github.com/texxasrulez "texxasrulez (10 commits)")

### Embed Badge

![Health badge](/badges/texxasrulez-rc-shield/health.svg)

```
[![Health](https://phpackages.com/badges/texxasrulez-rc-shield/health.svg)](https://phpackages.com/packages/texxasrulez-rc-shield)
```

###  Alternatives

[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k18.0M133](/packages/mews-purifier)[roundcube/roundcubemail

The Roundcube Webmail suite

7.0k1.4k3](/packages/roundcube-roundcubemail)[toteph42/identity_switch

This plugin allows users to switch between different identities (and check for new mails) in a single Roundcube session.

221.4k](/packages/toteph42-identity-switch)[paragonie/ecc

PHP Elliptic Curve Cryptography library

24772.0k35](/packages/paragonie-ecc)[fof/recaptcha

Increase your forum's security with Google reCAPTCHA

1436.9k](/packages/fof-recaptcha)[enupal/backup

Fully integrated Backup solution for Craft CMS

1612.5k1](/packages/enupal-backup)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
