diff --git a/CHANGELOG.md b/CHANGELOG.md index a4e6e7e..d3d5ec7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), ## [Unreleased] +## [0.3.0] - 2026-11-27 + +### Changed +- Downloads reduced to 7 SpamBlocker files (`spamblocker-full-setup`, `-settings`, `-all-rules` and one per group, `spamblocker-`) in 4 essential groups plus raw CSV/JSON; per-pattern import files removed. Block patterns now carry a `group` (header line and raw `group` column). + +### Added +- Raw, app-agnostic lists in `raw/`: `spamwall-in.csv`, `spamwall-in.json` (with a `meta` object) and `spamwall-in.md`. +- `rules/in/numbers/IN-REPORTED-BUSINESS.txt`: business landline, toll-free and series numbers reported as spam (mobiles excluded for privacy). Used in the raw lists only, not in the SpamBlocker files. +- Checks that `raw/` is current, that no 10-digit 6-9 mobile appears in numbers or raw files, and that each number parses. +- README and `docs/IMPORT.md` file tables with labels and download links, and a "Using SpamWall without SpamBlocker" section. + ## [0.2.0] - 2026-11-27 ### Added @@ -28,6 +39,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), - One-click SpamBlocker import files and plain regex lists. - Unblock-request and new-pattern issue templates. -[Unreleased]: https://github.com/wasimness/spamwall/compare/v0.2.0...HEAD +[Unreleased]: https://github.com/wasimness/spamwall/compare/v0.3.0...HEAD +[0.3.0]: https://github.com/wasimness/spamwall/compare/v0.2.0...v0.3.0 [0.2.0]: https://github.com/wasimness/spamwall/compare/v0.1.0...v0.2.0 [0.1.0]: https://github.com/wasimness/spamwall/releases/tag/v0.1.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c22d5c4..90393ff 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing -- Rules live in `rules//`: one file per pattern in `allow/`, `block/` and `optional/` (named by ID), and `allow-apps.txt`. +- Rules live in `rules//`: one file per pattern in `allow/`, `block/` and `optional/` (named by ID), and `allow-apps.txt`. Every new `block/` or `optional/` pattern must name its group in a `# Group: ` header line: `telemarketing`, `call-centres`, `spam-mobiles` or `banks-govt` (groups are defined in `tools/build_spamblocker.py`; a new group needs a maintainer decision and README/IMPORT table rows). - One regex per line, matched against the national number (no country code, no leading 0), followed by `# ID | what | source`. - Prefer a range (pattern) over single numbers, but keep it narrow: a block must not catch shopping, delivery, ride, payment, bank or government service calls. - Never add official service series (India: 1600, 1601) to `block/`. diff --git a/README.md b/README.md index 2c3a897..4088874 100644 --- a/README.md +++ b/README.md @@ -2,47 +2,59 @@ ![SpamWall: spam call and SMS block patterns for India](assets/banner.svg) -**For Indian phone numbers (+91), calls and SMS.** SpamWall is a set of pattern-based block rules you can import in one click. It is built for [SpamBlocker](https://github.com/aj3423/SpamBlocker) on Android; the plain regex lists work in any blocker that accepts regular expressions. +**For Indian phone numbers (+91), calls and SMS.** SpamWall is an open list of spam number patterns and numbers. Use the raw CSV or JSON lists in any blocker app, or import the ready-made files into SpamBlocker, the Android app we currently use. It blocks whole number ranges used by telemarketers and call centres instead of single numbers. Every rule filters both calls and SMS. Calls and messages from shopping, delivery, ride and payment apps, from your contacts, and from official service lines are never blocked. > SMS filtering works only when **SMS** is switched on under *Settings > Screening* in SpamBlocker; follow the setup prompt it shows. -## The app: SpamBlocker +## The app we currently use -SpamWall's import files are made for **[SpamBlocker](https://github.com/aj3423/SpamBlocker)**, a free, open-source call and SMS blocker for Android by aj3423. It is the app the maintainer uses every day with these rules. +We use **[SpamBlocker](https://github.com/aj3423/SpamBlocker)** (free, open source, Android), so the one-click import files are in its format. Any other blocker works with the raw lists. -- Get it from [F-Droid](https://f-droid.org/packages/spam.blocker/) or the [GitHub releases page](https://github.com/aj3423/SpamBlocker/releases). -- It runs on your phone with no account, and number checks happen on the device. -- Questions about the app itself go to the [SpamBlocker repository](https://github.com/aj3423/SpamBlocker/issues); questions about these rules go [here](../../issues). +- Get SpamBlocker from [F-Droid](https://f-droid.org/packages/spam.blocker/) or its [GitHub releases](https://github.com/aj3423/SpamBlocker/releases). +- App questions go to the [SpamBlocker repository](https://github.com/aj3423/SpamBlocker/issues); questions about these lists go [here](../../issues). -SpamWall is a separate community project and is not made by or affiliated with SpamBlocker. +SpamWall is an independent project, not made by or affiliated with SpamBlocker. -## Quick start (SpamBlocker) +## Quick start (if you use SpamBlocker) 1. Export a backup first (**Settings > Backup > Export**), because an import replaces your number rules. -2. Download [`spamblocker/complete.gz`](spamblocker/complete.gz), then **Settings > Backup > Import** and pick it. +2. Download [`spamblocker/spamblocker-full-setup.gz`](spamblocker/spamblocker-full-setup.gz), then **Settings > Backup > Import** and pick it. 3. Follow the full guide, including the manual steps the import cannot do: [docs/IMPORT.md](docs/IMPORT.md). ## Files -| File | What it has | -|---|---| -| [`spamblocker/settings.gz`](spamblocker/settings.gz) | Only the Others category (contacts, STIR, repeated call, dialed, answered, Recent Apps) | -| [`spamblocker/rules-default.gz`](spamblocker/rules-default.gz) | Only the Regex Settings category: allow rules and default block rules | -| [`spamblocker/rules-strict.gz`](spamblocker/rules-strict.gz) | `rules-default` plus IN-1600 (bank and government service calls) | -| [`spamblocker/complete.gz`](spamblocker/complete.gz) | `settings` plus `rules-default`, for a one-tap full setup | -| [`spamblocker/types/.gz`](spamblocker/types/) | One block pattern plus the allow rules (Regex Settings only), for blocking just one kind of call | -| [`rules/in/`](rules/in/) | One file per pattern in `allow/`, `block/` and `optional/`, plus [`allow-apps.txt`](rules/in/allow-apps.txt) | -| [`rules/in/patterns.md`](rules/in/patterns.md) | Table of every pattern, generated from the files | +| Label | File | Description | Download | +|---|---|---|---| +| Full setup (recommended) | `spamblocker-full-setup.gz` | App settings plus all spam rules in one import | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-full-setup.gz) | +| App settings only | `spamblocker-settings.gz` | Only the Others category: contacts, STIR, repeated call, dialed, answered, Recent Apps | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-settings.gz) | +| All spam rules | `spamblocker-all-rules.gz` | Allow rules plus the three default groups (not the bank group) | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-all-rules.gz) | +| Promo and telemarketing calls | `spamblocker-telemarketing.gz` | Group `telemarketing`: the 140 promotional series, plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-telemarketing.gz) | +| Call-centre ranges | `spamblocker-call-centres.gz` | Group `call-centres`: call-centre landline and Bengaluru ranges, plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-call-centres.gz) | +| Spam mobile ranges | `spamblocker-spam-mobiles.gz` | Group `spam-mobiles`: bulk telemarketing mobile ranges, plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-spam-mobiles.gz) | +| Bank and government calls (optional) | `spamblocker-banks-govt.gz` | Group `banks-govt`: the official 1600 series (also blocks your real bank), plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-banks-govt.gz) | +| Raw list (CSV) | `spamwall-in.csv` | Every pattern and business number with its group, for any app or spreadsheet | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-in.csv) | +| Raw list (JSON) | `spamwall-in.json` | Same data with a meta object, for scripts and AI | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-in.json) | + +Groups don't stack in SpamBlocker (each rules import replaces the number rules), so to block two groups, import `spamblocker-all-rules.gz`, or import one group and add the other patterns by hand from `rules/in/`. For all rules plus banks, import `spamblocker-all-rules.gz`, then add the IN-1600 pattern by hand. -Each `.gz` has a readable `.json` twin. +Each `.gz` has a readable `.json` twin in `spamblocker/`. The raw list also exists as a Markdown table, [`raw/spamwall-in.md`](raw/spamwall-in.md), for reading in the repo (not a release download). Source rules: [`rules/in/`](rules/in/) (one file per pattern in `allow/`, `block/` and `optional/`, each block pattern with a `# Group:` line, plus [`allow-apps.txt`](rules/in/allow-apps.txt) and `numbers/`), table of every pattern: [`rules/in/patterns.md`](rules/in/patterns.md). -**What can be combined:** `settings` + any ONE rules file (`rules-default`, `rules-strict` or one `types/` file) is fine. Two rules files do not stack: the second replaces the first, and also deletes your own number rules. `complete` already has settings and default rules. +**What can be combined:** `spamblocker-settings.gz` + any ONE rules file is fine. `spamblocker-full-setup.gz` already has settings and all default rules. -**Short version of the caveats:** settings never touch number rules; rules never touch settings. Importing `settings.gz` replaces your Recent Apps list and allow switches. Export a backup first, it is your undo. Not tested on every phone and SpamBlocker version, so report problems as issues. Details: [docs/IMPORT.md](docs/IMPORT.md). +**Short version of the caveats:** settings never touch number rules; rules never touch settings. Importing `spamblocker-settings.gz` replaces your Recent Apps list and allow switches. Export a backup first, it is your undo. Not tested on every phone and SpamBlocker version, so report problems as issues. Details: [docs/IMPORT.md](docs/IMPORT.md). **Releases:** download the files from the [latest release](../../releases/latest). +## Using SpamWall without SpamBlocker + +The raw lists in `raw/` (CSV, JSON) are app-agnostic: the same rows as the SpamBlocker files, with columns `type,id,kind,value,description,source,priority,group`. `type` is allow, block or optional; `group` is the block group (`telemarketing`, `call-centres`, `spam-mobiles`, `banks-govt`; empty for allow rows and numbers); `kind` is `pattern` (a regular expression) or `number` (an exact number). Numbers and patterns match the national number, without +91 or a leading 0. + +- **Any blocker or your phone's own block list:** open the CSV file and copy what you need. Add `number` rows one by one, or paste them in bulk where the app allows. +- **Patterns need regex or prefix blocking.** If your app only blocks exact numbers, use the `number` rows. If it supports prefixes, turn simple patterns such as `^140\d{7}$` into the prefix `140`. +- **Build rules for another app with AI or a script:** feed `spamwall-in.json` (rules plus a `meta` object) to an AI assistant or a script and ask it to produce the format your app imports. +- **Mobile numbers are left out on purpose.** Individual 10-digit mobile numbers (starting 6 to 9) are never listed, for privacy. Only landline, toll-free and series numbers appear as `number` rows. + ## How the rules are checked SpamBlocker checks higher priorities first. Allow and block rules never share a priority. @@ -73,13 +85,13 @@ Numbers are matched without `+91` or a leading `0`. | IN-CC-BLR | `^(803710\|...)\d{4}$` | Narrow Bengaluru call-centre blocks. Bengaluru `080` numbers are not blocked as a whole, because delivery apps call from them | Clustered from community spam reports | | IN-BULK-MOBILE | `^(657350\|...)\d{4}$` | Mobile number blocks used for bulk telemarketing | Clustered from community spam reports | -### Optional (`rules-strict` only) +### Optional (group `banks-govt` only) | ID | Pattern | What it blocks | Why it is off by default | |---|---|---|---| | IN-1600 | `^1600\d{6}$` | Service and transactional calls from banks, insurers, brokers, mutual funds and government | This is the **official** series that regulated entities must use ([TRAI, PIB](https://pib.gov.in/PressReleasePage.aspx?PRID=2191647)). Blocking it also blocks your real bank. | -**Credit card and loan spam:** promotions must come from the 140 series, which is blocked. Official bank calls must come from 1600, which stays allowed in the default file. A loan or credit-card pitch from an ordinary mobile or landline breaks TRAI rules; report it in the **Report Spam** app (TRAI DND) and open a *New spam pattern* issue here. +**Credit card and loan spam:** promotions must come from the 140 series, which is blocked. Official bank calls must come from 1600, which is not blocked by `spamblocker-full-setup.gz` or `spamblocker-all-rules.gz`. A loan or credit-card pitch from an ordinary mobile or landline breaks TRAI rules; report it in the **Report Spam** app (TRAI DND) and open a *New spam pattern* issue here. ## Blocked by mistake? @@ -87,7 +99,7 @@ Open an [**Unblock request**](../../issues/new?template=unblock-request.yml). Gi ## Contributing -See [CONTRIBUTING.md](CONTRIBUTING.md). Edit the files in `rules//allow/`, `block/` and `optional/`, then run `python -I tools/build_spamblocker.py` to rebuild the import files. +See [CONTRIBUTING.md](CONTRIBUTING.md). Edit the files in `rules//allow/`, `block/` and `optional/` (a new block pattern must name its group), then run `python -I tools/build_spamblocker.py` to rebuild the import files. ## License diff --git a/docs/IMPORT.md b/docs/IMPORT.md index c2c52b7..1be7319 100644 --- a/docs/IMPORT.md +++ b/docs/IMPORT.md @@ -2,9 +2,9 @@ > **Read this first** > -> - Settings and rules import separately. `settings.gz` only touches app settings (allow switches, Recent Apps) and never your number rules. `rules-*.gz` and `types/*.gz` only touch number rules. `complete.gz` does both. -> - Number-rule imports do not stack. Each import replaces ALL number rules, including your own and any earlier SpamWall import. Pick ONE: a single type file (blocks only that kind of call) OR `rules-default.gz` / `rules-strict.gz` (all types). For two or three types, import the all-types file, or import one type file and add the other patterns by hand with "New" in Number Rules, copying the regex from `rules/in/block/.txt`. -> - Importing `settings.gz` replaces your Recent Apps list and the allow switches. +> - Settings and rules import separately. `spamblocker-settings.gz` only touches app settings (allow switches, Recent Apps) and never your number rules. `spamblocker-all-rules.gz` and the four group files (`spamblocker-telemarketing.gz`, `spamblocker-call-centres.gz`, `spamblocker-spam-mobiles.gz`, `spamblocker-banks-govt.gz`) only touch number rules. `spamblocker-full-setup.gz` does both. +> - Number-rule imports do not stack. Each import replaces ALL number rules, including your own and any earlier SpamWall import. To block two or three groups, import `spamblocker-all-rules.gz`, or import one group and add the other patterns by hand with "New" in Number Rules, copying the regex from `rules/in/block/.txt`. For all rules plus banks, import `spamblocker-all-rules.gz` and add IN-1600 (from `rules/in/optional/IN-1600.txt`) by hand. +> - Importing `spamblocker-settings.gz` replaces your Recent Apps list and the allow switches. > - Always export a backup first; importing it again is the undo. > - The maintainer has not tested this on every phone and SpamBlocker version. Report problems as [issues](../../issues). @@ -14,27 +14,43 @@ SpamBlocker for Android, from [F-Droid](https://f-droid.org/packages/spam.blocke ## Which file to pick -| File | What it has | Pick it when | -|---|---|---| -| `complete.gz` | Settings plus default rules (both categories) | You want a full setup in one tap | -| `settings.gz` | Only the "Others" category: contacts, STIR, repeated call, dialed, answered, Recent Apps (120 min) | You want the settings without touching your number rules | -| `rules-default.gz` | Only the "Regex Settings" category: all allow rules and the default block rules | You want the rules without touching your settings | -| `types/.gz` | One block pattern (IN-140, IN-CC-LANDLINE, IN-CC-BLR, IN-BULK-MOBILE or IN-1600) plus the allow rules (IN-1601, IN-AMAZON). Regex Settings only | You want to block only that kind of call | -| `rules-strict.gz` | Same as `rules-default.gz` plus IN-1600 | You also want bank, insurer and government service calls blocked (add your own bank and broker numbers to contacts first) | +| Label | File | Description | Download | +|---|---|---|---| +| Full setup (recommended) | `spamblocker-full-setup.gz` | App settings plus all spam rules in one import | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-full-setup.gz) | +| App settings only | `spamblocker-settings.gz` | Only the Others category: contacts, STIR, repeated call, dialed, answered, Recent Apps | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-settings.gz) | +| All spam rules | `spamblocker-all-rules.gz` | Allow rules plus the three default groups (not the bank group) | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-all-rules.gz) | +| Promo and telemarketing calls | `spamblocker-telemarketing.gz` | Group `telemarketing`: the 140 promotional series, plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-telemarketing.gz) | +| Call-centre ranges | `spamblocker-call-centres.gz` | Group `call-centres`: call-centre landline and Bengaluru ranges, plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-call-centres.gz) | +| Spam mobile ranges | `spamblocker-spam-mobiles.gz` | Group `spam-mobiles`: bulk telemarketing mobile ranges, plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-spam-mobiles.gz) | +| Bank and government calls (optional) | `spamblocker-banks-govt.gz` | Group `banks-govt`: the official 1600 series (also blocks your real bank), plus the allow rules | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamblocker-banks-govt.gz) | +| Raw list (CSV) | `spamwall-in.csv` | Every pattern and business number with its group, for any app or spreadsheet | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-in.csv) | +| Raw list (JSON) | `spamwall-in.json` | Same data with a meta object, for scripts and AI | [Download](https://github.com/wasimness/spamwall/releases/latest/download/spamwall-in.json) | + +Groups don't stack in SpamBlocker (each rules import replaces the number rules), so to block two groups, import `spamblocker-all-rules.gz`, or import one group and add the other patterns by hand from `rules/in/`. For all rules plus banks, import `spamblocker-all-rules.gz`, then add the IN-1600 pattern by hand. + +Each `.gz` also has a readable `.json` twin in `spamblocker/`. The Markdown table `raw/spamwall-in.md` is for reading in the repo, not a release download. Release assets are flat, so every file name is unique. + +## Using SpamWall without SpamBlocker + +The raw lists in `raw/` (CSV, JSON) are app-agnostic: the same rows as the SpamBlocker files, with columns `type,id,kind,value,description,source,priority,group`. `type` is allow, block or optional; `group` is the block group (`telemarketing`, `call-centres`, `spam-mobiles`, `banks-govt`; empty for allow rows and numbers); `kind` is `pattern` (a regular expression) or `number` (an exact number). Numbers and patterns match the national number, without +91 or a leading 0. + +- **Any blocker or your phone's own block list:** open the CSV file and copy what you need. Add `number` rows one by one, or paste them in bulk where the app allows. +- **Patterns need regex or prefix blocking.** If your app only blocks exact numbers, use the `number` rows. If it supports prefixes, turn simple patterns such as `^140\d{7}$` into the prefix `140`. +- **Build rules for another app with AI or a script:** feed `spamwall-in.json` (rules plus a `meta` object) to an AI assistant or a script and ask it to produce the format your app imports. +- **Mobile numbers are left out on purpose.** Individual 10-digit mobile numbers (starting 6 to 9) are never listed, for privacy. Only landline, toll-free and series numbers appear as `number` rows. -Each file also has a readable `.json` twin in `spamblocker/`. ## Step-by-step import 1. In SpamBlocker, open **Settings > Backup > Export** and save a backup of your current setup first. 2. Download the file you picked to your phone. 3. Open **Settings > Backup > Import** and pick the file. -4. In the **Include Settings** dialog, tap a category to move it between Include and Exclude. Keep only the category the file has (Others for `settings.gz`, Regex Settings for `rules-*.gz` and `types/*.gz`, both for `complete.gz`). +4. In the **Include Settings** dialog, tap a category to move it between Include and Exclude. Keep only the category the file has (Others for `spamblocker-settings.gz`, Regex Settings for `spamblocker-all-rules.gz` and the four group files (`spamblocker-telemarketing.gz`, `spamblocker-call-centres.gz`, `spamblocker-spam-mobiles.gz`, `spamblocker-banks-govt.gz`), both for `spamblocker-full-setup.gz`). 5. Confirm the import. ## Nuances -- Import REPLACES the whole section. Number rules are cleared and re-added, so importing a `rules-*.gz` file (or `complete.gz`) deletes your own number rules. Export first, or add your own rules again afterwards. +- Import REPLACES the whole section. Number rules are cleared and re-added, so importing a `spamblocker-all-rules.gz` or the four group files (`spamblocker-telemarketing.gz`, `spamblocker-call-centres.gz`, `spamblocker-spam-mobiles.gz`, `spamblocker-banks-govt.gz`) file (or `spamblocker-full-setup.gz`) deletes your own number rules. Export first, or add your own rules again afterwards. - A file that lacks a category shows "This setting is missing from the backup file and cannot be restored" for that category. Exclude it, as in step 4. - Allow and block rules must never share a priority. Here allow is 15, the built-in allow checks are 10 and block is 5. - Numbers are matched without +91 or a leading 0. @@ -45,7 +61,7 @@ Each file also has a readable `.json` twin in `spamblocker/`. - Grant SpamBlocker's permissions when it asks: the call screening role, contacts, and usage access for Recent Apps. - Turn on SMS screening under **Settings > Screening** if you want it, and follow the app's prompts. -- Add your own bank and broker numbers to contacts (with the strict file). +- Add your own bank and broker numbers to contacts (if you add the bank group). - Optionally turn off Tellows, which sends unknown numbers to tellows.com. - On Xiaomi/MIUI, allow autostart and set no battery restriction for SpamBlocker so screening keeps running. diff --git a/raw/spamwall-in.csv b/raw/spamwall-in.csv new file mode 100644 index 0000000..30a97f3 --- /dev/null +++ b/raw/spamwall-in.csv @@ -0,0 +1,99 @@ +type,id,kind,value,description,source,priority,group +allow,IN-1601,pattern,^1601\d{6}$,"Official series for utilities, courier and logistics (deliveries)",TRAI Direction 10-08-2026,15, +allow,IN-AMAZON,pattern,^2263257863$,Amazon India customer service,public number,15, +block,IN-140,pattern,^140\d{7}$,Promotional / telemarketing series,TRAI TCCCPR 2018; RBI circular 2025-01 (140 = promotional only),5,telemarketing +block,IN-BULK-MOBILE,pattern,^(657350|731361|914714|922807|942209|948470)\d{4}$,Bulk telemarketing mobile ranges,clustered from community spam reports,5,spam-mobiles +block,IN-CC-BLR,pattern,^(803710|803720|804795|804819|806935|806954|806985)\d{4}$,Bengaluru call-centre blocks,clustered from community spam reports,5,call-centres +block,IN-CC-LANDLINE,pattern,^(1725|2250|2269|3366|3368|3371|4071|7935|7969|7971)\d{6}$,"Call-centre landline ranges (Chandigarh, Mumbai, Kolkata, Hyderabad, Ahmedabad)",clustered from community spam reports,5,call-centres +optional,IN-1600,pattern,^1600\d{6}$,"Official BFSI + Government service/transactional series. Blocks REAL bank, insurer, broker and govt calls too. Enable only if you add your own banks to allow.txt",TRAI Direction (PIB PRID 2191647),5,banks-govt +block,IN-REPORTED-BUSINESS,number,1135137600,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1135139000,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1135354406,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1143079806,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1169116246,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1169116276,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1169123061,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1169123067,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1169123073,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1169123077,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1171638728,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1203127415,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1205083920,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1205168718,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1205173629,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1205173679,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1206435655,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1206435785,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1206436017,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1206916334,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1206916340,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1206916384,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1206916404,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1206916456,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1206924342,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1244180472,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1244790463,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1244790469,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1245148270,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1353501240,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1353501248,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1414762633,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1416180507,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1416180559,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1600318752,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,1726741521,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,2045907791,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,2048566470,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,2067451410,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,2067801163,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,2067874503,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,2067874970,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,2068283912,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,2069137002,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,2071243006,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,2235018668,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,2243691029,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,2245870590,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,2268539628,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,2268700283,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,2423351750,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,2488715097,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,2653103252,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3335002601,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3335302610,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3340222381,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3340582902,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3340582923,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3340912900,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3340912932,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3340912946,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3340927234,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3340927334,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3344053501,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3344453585,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3348072549,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3349495947,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3361210639,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3361253369,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3361254412,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3361254428,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3361367329,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3369051308,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3369068433,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3369093908,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3369095418,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,3369096046,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,4038021223,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,4069654518,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,4069654612,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,4069658515,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,4461703549,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,4471637887,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,4471894908,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,5227159327,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,5227159533,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,5227165134,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,5227185470,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,5227187119,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,5227187120,Business number reported as spam,community spam reports,5, +block,IN-REPORTED-BUSINESS,number,5227188859,Business number reported as spam,community spam reports,5, diff --git a/raw/spamwall-in.json b/raw/spamwall-in.json new file mode 100644 index 0000000..f649773 --- /dev/null +++ b/raw/spamwall-in.json @@ -0,0 +1,992 @@ +{ + "meta": { + "name": "SpamWall", + "version": "0.3.0", + "country": "IN", + "matching": "national number without +91 or leading 0", + "license": "MIT", + "repo": "https://github.com/wasimness/spamwall" + }, + "rules": [ + { + "type": "allow", + "id": "IN-1601", + "kind": "pattern", + "value": "^1601\\d{6}$", + "description": "Official series for utilities, courier and logistics (deliveries)", + "source": "TRAI Direction 10-08-2026", + "priority": 15, + "group": "" + }, + { + "type": "allow", + "id": "IN-AMAZON", + "kind": "pattern", + "value": "^2263257863$", + "description": "Amazon India customer service", + "source": "public number", + "priority": 15, + "group": "" + }, + { + "type": "block", + "id": "IN-140", + "kind": "pattern", + "value": "^140\\d{7}$", + "description": "Promotional / telemarketing series", + "source": "TRAI TCCCPR 2018; RBI circular 2025-01 (140 = promotional only)", + "priority": 5, + "group": "telemarketing" + }, + { + "type": "block", + "id": "IN-BULK-MOBILE", + "kind": "pattern", + "value": "^(657350|731361|914714|922807|942209|948470)\\d{4}$", + "description": "Bulk telemarketing mobile ranges", + "source": "clustered from community spam reports", + "priority": 5, + "group": "spam-mobiles" + }, + { + "type": "block", + "id": "IN-CC-BLR", + "kind": "pattern", + "value": "^(803710|803720|804795|804819|806935|806954|806985)\\d{4}$", + "description": "Bengaluru call-centre blocks", + "source": "clustered from community spam reports", + "priority": 5, + "group": "call-centres" + }, + { + "type": "block", + "id": "IN-CC-LANDLINE", + "kind": "pattern", + "value": "^(1725|2250|2269|3366|3368|3371|4071|7935|7969|7971)\\d{6}$", + "description": "Call-centre landline ranges (Chandigarh, Mumbai, Kolkata, Hyderabad, Ahmedabad)", + "source": "clustered from community spam reports", + "priority": 5, + "group": "call-centres" + }, + { + "type": "optional", + "id": "IN-1600", + "kind": "pattern", + "value": "^1600\\d{6}$", + "description": "Official BFSI + Government service/transactional series. Blocks REAL bank, insurer, broker and govt calls too. Enable only if you add your own banks to allow.txt", + "source": "TRAI Direction (PIB PRID 2191647)", + "priority": 5, + "group": "banks-govt" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1135137600", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1135139000", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1135354406", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1143079806", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1169116246", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1169116276", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1169123061", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1169123067", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1169123073", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1169123077", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1171638728", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1203127415", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1205083920", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1205168718", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1205173629", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1205173679", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1206435655", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1206435785", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1206436017", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1206916334", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1206916340", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1206916384", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1206916404", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1206916456", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1206924342", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1244180472", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1244790463", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1244790469", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1245148270", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1353501240", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1353501248", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1414762633", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1416180507", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1416180559", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1600318752", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "1726741521", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "2045907791", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "2048566470", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "2067451410", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "2067801163", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "2067874503", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "2067874970", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "2068283912", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "2069137002", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "2071243006", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "2235018668", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "2243691029", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "2245870590", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "2268539628", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "2268700283", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "2423351750", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "2488715097", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "2653103252", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3335002601", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3335302610", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3340222381", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3340582902", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3340582923", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3340912900", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3340912932", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3340912946", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3340927234", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3340927334", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3344053501", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3344453585", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3348072549", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3349495947", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3361210639", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3361253369", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3361254412", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3361254428", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3361367329", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3369051308", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3369068433", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3369093908", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3369095418", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "3369096046", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "4038021223", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "4069654518", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "4069654612", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "4069658515", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "4461703549", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "4471637887", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "4471894908", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "5227159327", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "5227159533", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "5227165134", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "5227185470", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "5227187119", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "5227187120", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + }, + { + "type": "block", + "id": "IN-REPORTED-BUSINESS", + "kind": "number", + "value": "5227188859", + "description": "Business number reported as spam", + "source": "community spam reports", + "priority": 5, + "group": "" + } + ] +} diff --git a/raw/spamwall-in.md b/raw/spamwall-in.md new file mode 100644 index 0000000..2070222 --- /dev/null +++ b/raw/spamwall-in.md @@ -0,0 +1,105 @@ + +# SpamWall IN raw list (v0.3.0) + +Numbers are matched as the national number, without +91 or a leading 0. Patterns are regular expressions; numbers are exact matches. + +| type | id | kind | value | description | source | priority | group | +|---|---|---|---|---|---|---|---| +| allow | IN-1601 | pattern | `^1601\d{6}$` | Official series for utilities, courier and logistics (deliveries) | TRAI Direction 10-08-2026 | 15 | | +| allow | IN-AMAZON | pattern | `^2263257863$` | Amazon India customer service | public number | 15 | | +| block | IN-140 | pattern | `^140\d{7}$` | Promotional / telemarketing series | TRAI TCCCPR 2018; RBI circular 2025-01 (140 = promotional only) | 5 | telemarketing | +| block | IN-BULK-MOBILE | pattern | `^(657350\|731361\|914714\|922807\|942209\|948470)\d{4}$` | Bulk telemarketing mobile ranges | clustered from community spam reports | 5 | spam-mobiles | +| block | IN-CC-BLR | pattern | `^(803710\|803720\|804795\|804819\|806935\|806954\|806985)\d{4}$` | Bengaluru call-centre blocks | clustered from community spam reports | 5 | call-centres | +| block | IN-CC-LANDLINE | pattern | `^(1725\|2250\|2269\|3366\|3368\|3371\|4071\|7935\|7969\|7971)\d{6}$` | Call-centre landline ranges (Chandigarh, Mumbai, Kolkata, Hyderabad, Ahmedabad) | clustered from community spam reports | 5 | call-centres | +| optional | IN-1600 | pattern | `^1600\d{6}$` | Official BFSI + Government service/transactional series. Blocks REAL bank, insurer, broker and govt calls too. Enable only if you add your own banks to allow.txt | TRAI Direction (PIB PRID 2191647) | 5 | banks-govt | +| block | IN-REPORTED-BUSINESS | number | `1135137600` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1135139000` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1135354406` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1143079806` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1169116246` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1169116276` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1169123061` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1169123067` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1169123073` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1169123077` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1171638728` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1203127415` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1205083920` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1205168718` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1205173629` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1205173679` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1206435655` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1206435785` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1206436017` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1206916334` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1206916340` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1206916384` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1206916404` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1206916456` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1206924342` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1244180472` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1244790463` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1244790469` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1245148270` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1353501240` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1353501248` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1414762633` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1416180507` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1416180559` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1600318752` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `1726741521` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `2045907791` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `2048566470` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `2067451410` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `2067801163` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `2067874503` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `2067874970` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `2068283912` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `2069137002` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `2071243006` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `2235018668` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `2243691029` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `2245870590` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `2268539628` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `2268700283` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `2423351750` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `2488715097` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `2653103252` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3335002601` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3335302610` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3340222381` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3340582902` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3340582923` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3340912900` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3340912932` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3340912946` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3340927234` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3340927334` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3344053501` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3344453585` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3348072549` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3349495947` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3361210639` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3361253369` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3361254412` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3361254428` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3361367329` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3369051308` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3369068433` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3369093908` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3369095418` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `3369096046` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `4038021223` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `4069654518` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `4069654612` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `4069658515` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `4461703549` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `4471637887` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `4471894908` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `5227159327` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `5227159533` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `5227165134` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `5227185470` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `5227187119` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `5227187120` | Business number reported as spam | community spam reports | 5 | | +| block | IN-REPORTED-BUSINESS | number | `5227188859` | Business number reported as spam | community spam reports | 5 | | diff --git a/rules/in/block/IN-140.txt b/rules/in/block/IN-140.txt index f5008b2..7ff9b36 100644 --- a/rules/in/block/IN-140.txt +++ b/rules/in/block/IN-140.txt @@ -1,4 +1,5 @@ # SpamWall India BLOCK pattern (national number without +91 or leading 0) +# Group: telemarketing # Blocks: promotional and telemarketing calls and SMS from the 140 series. # Source: TRAI TCCCPR 2018 https://trai.gov.in/release-publication/directions ; RBI circular Jan 2025 https://www.rbi.org.in/scripts/NotificationUser.aspx?Id=12770 # False-positive risk: low. The series is for promotions only. diff --git a/rules/in/block/IN-BULK-MOBILE.txt b/rules/in/block/IN-BULK-MOBILE.txt index 2e69a40..d9f5443 100644 --- a/rules/in/block/IN-BULK-MOBILE.txt +++ b/rules/in/block/IN-BULK-MOBILE.txt @@ -1,4 +1,5 @@ # SpamWall India BLOCK pattern (national number without +91 or leading 0) +# Group: spam-mobiles # Blocks: mobile number blocks used for bulk telemarketing. # Source: clustered from community spam reports. # False-positive risk: medium. Mobile blocks can be reassigned to ordinary users. diff --git a/rules/in/block/IN-CC-BLR.txt b/rules/in/block/IN-CC-BLR.txt index aecd51f..424a763 100644 --- a/rules/in/block/IN-CC-BLR.txt +++ b/rules/in/block/IN-CC-BLR.txt @@ -1,4 +1,5 @@ # SpamWall India BLOCK pattern (national number without +91 or leading 0) +# Group: call-centres # Blocks: narrow Bengaluru call-centre blocks (not all of 080). # Source: clustered from community spam reports. # False-positive risk: medium. Delivery apps call from other 080 numbers, which are not blocked. diff --git a/rules/in/block/IN-CC-LANDLINE.txt b/rules/in/block/IN-CC-LANDLINE.txt index 2d47d3f..7060714 100644 --- a/rules/in/block/IN-CC-LANDLINE.txt +++ b/rules/in/block/IN-CC-LANDLINE.txt @@ -1,4 +1,5 @@ # SpamWall India BLOCK pattern (national number without +91 or leading 0) +# Group: call-centres # Blocks: call-centre landline ranges in Chandigarh, Mumbai, Kolkata, Hyderabad and Ahmedabad. # Source: clustered from community spam reports. # False-positive risk: medium. Ranges are narrow but a real business in them would be blocked; use an unblock request. diff --git a/rules/in/numbers/IN-REPORTED-BUSINESS.txt b/rules/in/numbers/IN-REPORTED-BUSINESS.txt new file mode 100644 index 0000000..6266488 --- /dev/null +++ b/rules/in/numbers/IN-REPORTED-BUSINESS.txt @@ -0,0 +1,95 @@ +# SpamWall, business landline, toll-free and series numbers reported as spam by the community. +# Mobile numbers (10 digits starting 6-9) are excluded for privacy. +# Matched without +91 or leading 0. One number per line, sorted, deduplicated. +# Numbers already covered by a SpamWall block pattern are left out. +1135137600 +1135139000 +1135354406 +1143079806 +1169116246 +1169116276 +1169123061 +1169123067 +1169123073 +1169123077 +1171638728 +1203127415 +1205083920 +1205168718 +1205173629 +1205173679 +1206435655 +1206435785 +1206436017 +1206916334 +1206916340 +1206916384 +1206916404 +1206916456 +1206924342 +1244180472 +1244790463 +1244790469 +1245148270 +1353501240 +1353501248 +1414762633 +1416180507 +1416180559 +1600318752 +1726741521 +2045907791 +2048566470 +2067451410 +2067801163 +2067874503 +2067874970 +2068283912 +2069137002 +2071243006 +2235018668 +2243691029 +2245870590 +2268539628 +2268700283 +2423351750 +2488715097 +2653103252 +3335002601 +3335302610 +3340222381 +3340582902 +3340582923 +3340912900 +3340912932 +3340912946 +3340927234 +3340927334 +3344053501 +3344453585 +3348072549 +3349495947 +3361210639 +3361253369 +3361254412 +3361254428 +3361367329 +3369051308 +3369068433 +3369093908 +3369095418 +3369096046 +4038021223 +4069654518 +4069654612 +4069658515 +4461703549 +4471637887 +4471894908 +5227159327 +5227159533 +5227165134 +5227185470 +5227187119 +5227187120 +5227188859 diff --git a/rules/in/optional/IN-1600.txt b/rules/in/optional/IN-1600.txt index 0481d45..e4426b6 100644 --- a/rules/in/optional/IN-1600.txt +++ b/rules/in/optional/IN-1600.txt @@ -1,4 +1,5 @@ -# SpamWall India OPTIONAL BLOCK pattern (off by default; only in rules-strict) +# SpamWall India OPTIONAL BLOCK pattern (off by default; only in the banks-govt group) +# Group: banks-govt # Blocks: official BFSI and government service and transactional series. # Source: TRAI Direction, PIB https://pib.gov.in/PressReleasePage.aspx?PRID=2191647 # False-positive risk: high. Blocks real bank, insurer, broker and government calls. Add your own banks to contacts first. diff --git a/spamblocker/rules-strict.gz b/spamblocker/rules-strict.gz deleted file mode 100644 index d5033a7..0000000 Binary files a/spamblocker/rules-strict.gz and /dev/null differ diff --git a/spamblocker/rules-strict.json b/spamblocker/rules-strict.json deleted file mode 100644 index d9556dc..0000000 --- a/spamblocker/rules-strict.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "categories": { - "all": [ - "REGEX_RULES" - ] - }, - "numberRules": { - "rules": [ - { - "id": 100, - "pattern": "^1601\\d{6}$", - "patternFlags": 8192, - "patternModeType": 0, - "patternExtra": "", - "patternExtraFlags": 0, - "patternExtraModeType": 0, - "description": "SpamWall IN-1601: Official series for utilities, courier and logistics (deliveries)", - "priority": 15, - "isBlacklist": false, - "flags": 3, - "channel": "Low", - "schedule": "", - "blockType": 0, - "blockTypeConfig": "" - }, - { - "id": 101, - "pattern": "^2263257863$", - "patternFlags": 8192, - "patternModeType": 0, - "patternExtra": "", - "patternExtraFlags": 0, - "patternExtraModeType": 0, - "description": "SpamWall IN-AMAZON: Amazon India customer service", - "priority": 15, - "isBlacklist": false, - "flags": 3, - "channel": "Low", - "schedule": "", - "blockType": 0, - "blockTypeConfig": "" - }, - { - "id": 200, - "pattern": "^140\\d{7}$", - "patternFlags": 8192, - "patternModeType": 0, - "patternExtra": "", - "patternExtraFlags": 0, - "patternExtraModeType": 0, - "description": "SpamWall IN-140: Promotional / telemarketing series", - "priority": 5, - "isBlacklist": true, - "flags": 3, - "channel": "Low", - "schedule": "", - "blockType": 0, - "blockTypeConfig": "" - }, - { - "id": 201, - "pattern": "^(657350|731361|914714|922807|942209|948470)\\d{4}$", - "patternFlags": 8192, - "patternModeType": 0, - "patternExtra": "", - "patternExtraFlags": 0, - "patternExtraModeType": 0, - "description": "SpamWall IN-BULK-MOBILE: Bulk telemarketing mobile ranges", - "priority": 5, - "isBlacklist": true, - "flags": 3, - "channel": "Low", - "schedule": "", - "blockType": 0, - "blockTypeConfig": "" - }, - { - "id": 202, - "pattern": "^(803710|803720|804795|804819|806935|806954|806985)\\d{4}$", - "patternFlags": 8192, - "patternModeType": 0, - "patternExtra": "", - "patternExtraFlags": 0, - "patternExtraModeType": 0, - "description": "SpamWall IN-CC-BLR: Bengaluru call-centre blocks", - "priority": 5, - "isBlacklist": true, - "flags": 3, - "channel": "Low", - "schedule": "", - "blockType": 0, - "blockTypeConfig": "" - }, - { - "id": 203, - "pattern": "^(1725|2250|2269|3366|3368|3371|4071|7935|7969|7971)\\d{6}$", - "patternFlags": 8192, - "patternModeType": 0, - "patternExtra": "", - "patternExtraFlags": 0, - "patternExtraModeType": 0, - "description": "SpamWall IN-CC-LANDLINE: Call-centre landline ranges (Chandigarh, Mumbai, Kolkata, Hyderabad, Ahmedabad)", - "priority": 5, - "isBlacklist": true, - "flags": 3, - "channel": "Low", - "schedule": "", - "blockType": 0, - "blockTypeConfig": "" - }, - { - "id": 204, - "pattern": "^1600\\d{6}$", - "patternFlags": 8192, - "patternModeType": 0, - "patternExtra": "", - "patternExtraFlags": 0, - "patternExtraModeType": 0, - "description": "SpamWall IN-1600: Official BFSI + Government service/transactional series. Blocks REAL bank, insurer, broker and govt ca", - "priority": 5, - "isBlacklist": true, - "flags": 3, - "channel": "Low", - "schedule": "", - "blockType": 0, - "blockTypeConfig": "" - } - ] - } -} \ No newline at end of file diff --git a/spamblocker/settings.gz b/spamblocker/settings.gz deleted file mode 100644 index 893c703..0000000 Binary files a/spamblocker/settings.gz and /dev/null differ diff --git a/spamblocker/rules-default.gz b/spamblocker/spamblocker-all-rules.gz similarity index 53% rename from spamblocker/rules-default.gz rename to spamblocker/spamblocker-all-rules.gz index 4e38616..0b71581 100644 Binary files a/spamblocker/rules-default.gz and b/spamblocker/spamblocker-all-rules.gz differ diff --git a/spamblocker/rules-default.json b/spamblocker/spamblocker-all-rules.json similarity index 100% rename from spamblocker/rules-default.json rename to spamblocker/spamblocker-all-rules.json diff --git a/spamblocker/types/IN-1600.gz b/spamblocker/spamblocker-banks-govt.gz similarity index 50% rename from spamblocker/types/IN-1600.gz rename to spamblocker/spamblocker-banks-govt.gz index 2bf7856..3a19034 100644 Binary files a/spamblocker/types/IN-1600.gz and b/spamblocker/spamblocker-banks-govt.gz differ diff --git a/spamblocker/types/IN-1600.json b/spamblocker/spamblocker-banks-govt.json similarity index 100% rename from spamblocker/types/IN-1600.json rename to spamblocker/spamblocker-banks-govt.json diff --git a/spamblocker/spamblocker-call-centres.gz b/spamblocker/spamblocker-call-centres.gz new file mode 100644 index 0000000..1524128 Binary files /dev/null and b/spamblocker/spamblocker-call-centres.gz differ diff --git a/spamblocker/types/IN-CC-LANDLINE.json b/spamblocker/spamblocker-call-centres.json similarity index 76% rename from spamblocker/types/IN-CC-LANDLINE.json rename to spamblocker/spamblocker-call-centres.json index 45dd12e..0ba989e 100644 --- a/spamblocker/types/IN-CC-LANDLINE.json +++ b/spamblocker/spamblocker-call-centres.json @@ -42,6 +42,23 @@ }, { "id": 200, + "pattern": "^(803710|803720|804795|804819|806935|806954|806985)\\d{4}$", + "patternFlags": 8192, + "patternModeType": 0, + "patternExtra": "", + "patternExtraFlags": 0, + "patternExtraModeType": 0, + "description": "SpamWall IN-CC-BLR: Bengaluru call-centre blocks", + "priority": 5, + "isBlacklist": true, + "flags": 3, + "channel": "Low", + "schedule": "", + "blockType": 0, + "blockTypeConfig": "" + }, + { + "id": 201, "pattern": "^(1725|2250|2269|3366|3368|3371|4071|7935|7969|7971)\\d{6}$", "patternFlags": 8192, "patternModeType": 0, diff --git a/spamblocker/complete.gz b/spamblocker/spamblocker-full-setup.gz similarity index 82% rename from spamblocker/complete.gz rename to spamblocker/spamblocker-full-setup.gz index 6db9c6f..00f2b61 100644 Binary files a/spamblocker/complete.gz and b/spamblocker/spamblocker-full-setup.gz differ diff --git a/spamblocker/complete.json b/spamblocker/spamblocker-full-setup.json similarity index 100% rename from spamblocker/complete.json rename to spamblocker/spamblocker-full-setup.json diff --git a/spamblocker/spamblocker-settings.gz b/spamblocker/spamblocker-settings.gz new file mode 100644 index 0000000..7b23fa0 Binary files /dev/null and b/spamblocker/spamblocker-settings.gz differ diff --git a/spamblocker/settings.json b/spamblocker/spamblocker-settings.json similarity index 100% rename from spamblocker/settings.json rename to spamblocker/spamblocker-settings.json diff --git a/spamblocker/spamblocker-spam-mobiles.gz b/spamblocker/spamblocker-spam-mobiles.gz new file mode 100644 index 0000000..e449e05 Binary files /dev/null and b/spamblocker/spamblocker-spam-mobiles.gz differ diff --git a/spamblocker/types/IN-BULK-MOBILE.json b/spamblocker/spamblocker-spam-mobiles.json similarity index 100% rename from spamblocker/types/IN-BULK-MOBILE.json rename to spamblocker/spamblocker-spam-mobiles.json diff --git a/spamblocker/spamblocker-telemarketing.gz b/spamblocker/spamblocker-telemarketing.gz new file mode 100644 index 0000000..39748f2 Binary files /dev/null and b/spamblocker/spamblocker-telemarketing.gz differ diff --git a/spamblocker/types/IN-140.json b/spamblocker/spamblocker-telemarketing.json similarity index 100% rename from spamblocker/types/IN-140.json rename to spamblocker/spamblocker-telemarketing.json diff --git a/spamblocker/types/IN-140.gz b/spamblocker/types/IN-140.gz deleted file mode 100644 index 0c7a3a7..0000000 Binary files a/spamblocker/types/IN-140.gz and /dev/null differ diff --git a/spamblocker/types/IN-BULK-MOBILE.gz b/spamblocker/types/IN-BULK-MOBILE.gz deleted file mode 100644 index 60e7399..0000000 Binary files a/spamblocker/types/IN-BULK-MOBILE.gz and /dev/null differ diff --git a/spamblocker/types/IN-CC-BLR.gz b/spamblocker/types/IN-CC-BLR.gz deleted file mode 100644 index 6c0c30c..0000000 Binary files a/spamblocker/types/IN-CC-BLR.gz and /dev/null differ diff --git a/spamblocker/types/IN-CC-BLR.json b/spamblocker/types/IN-CC-BLR.json deleted file mode 100644 index 511a533..0000000 --- a/spamblocker/types/IN-CC-BLR.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "categories": { - "all": [ - "REGEX_RULES" - ] - }, - "numberRules": { - "rules": [ - { - "id": 100, - "pattern": "^1601\\d{6}$", - "patternFlags": 8192, - "patternModeType": 0, - "patternExtra": "", - "patternExtraFlags": 0, - "patternExtraModeType": 0, - "description": "SpamWall IN-1601: Official series for utilities, courier and logistics (deliveries)", - "priority": 15, - "isBlacklist": false, - "flags": 3, - "channel": "Low", - "schedule": "", - "blockType": 0, - "blockTypeConfig": "" - }, - { - "id": 101, - "pattern": "^2263257863$", - "patternFlags": 8192, - "patternModeType": 0, - "patternExtra": "", - "patternExtraFlags": 0, - "patternExtraModeType": 0, - "description": "SpamWall IN-AMAZON: Amazon India customer service", - "priority": 15, - "isBlacklist": false, - "flags": 3, - "channel": "Low", - "schedule": "", - "blockType": 0, - "blockTypeConfig": "" - }, - { - "id": 200, - "pattern": "^(803710|803720|804795|804819|806935|806954|806985)\\d{4}$", - "patternFlags": 8192, - "patternModeType": 0, - "patternExtra": "", - "patternExtraFlags": 0, - "patternExtraModeType": 0, - "description": "SpamWall IN-CC-BLR: Bengaluru call-centre blocks", - "priority": 5, - "isBlacklist": true, - "flags": 3, - "channel": "Low", - "schedule": "", - "blockType": 0, - "blockTypeConfig": "" - } - ] - } -} \ No newline at end of file diff --git a/spamblocker/types/IN-CC-LANDLINE.gz b/spamblocker/types/IN-CC-LANDLINE.gz deleted file mode 100644 index f83e9fa..0000000 Binary files a/spamblocker/types/IN-CC-LANDLINE.gz and /dev/null differ diff --git a/tools/build_spamblocker.py b/tools/build_spamblocker.py index cb17aca..092708b 100644 --- a/tools/build_spamblocker.py +++ b/tools/build_spamblocker.py @@ -1,22 +1,41 @@ """Build the SpamBlocker import files from rules// and write patterns.md. Usage: python -I tools/build_spamblocker.py -Writes spamblocker/{settings,rules-default,rules-strict,complete}.{gz,json} -and rules//patterns.md. Old spamwall-*.{gz,json} files are removed. +Writes spamblocker/{spamblocker-full-setup,spamblocker-settings,spamblocker-all-rules,spamblocker-}.{gz,json}, +raw/spamwall-.{csv,json,md} and rules//patterns.md. Old spamwall-*.{gz,json} files are removed. """ +import csv import gzip +import io import json import re from pathlib import Path ROOT = Path(__file__).resolve().parent.parent OUT = ROOT / "spamblocker" +RAW = ROOT / "raw" +VERSION = "0.3.0" +REPO = "https://github.com/wasimness/spamwall" ALLOW_PRIORITY = 15 # whitelist rules run first BLOCK_PRIORITY = 5 # never equal to an allow priority (SpamBlocker issue #166) FLAGS_CALL_AND_SMS = 3 REGEX_FLAGS = 8192 +GROUPS = { # group slug -> label; the order is the order of the group files + "telemarketing": "Promo and telemarketing calls", + "call-centres": "Call-centre ranges", + "spam-mobiles": "Spam mobile ranges", + "banks-govt": "Bank and government calls (optional)", +} +DEFAULT_GROUPS = ["telemarketing", "call-centres", "spam-mobiles"] + + +def read_group(path): + m = re.search(r"^# Group:\s*(\S+)\s*$", path.read_text(encoding="utf-8"), re.M) + return m.group(1) if m else "" + + def read_rules(path): rules = [] if not path.exists(): @@ -28,6 +47,7 @@ def read_rules(path): pattern, _, note = line.partition("#") parts = [p.strip() for p in note.split("|")] rules.append({ + "group": read_group(path), "pattern": pattern.strip(), "id": parts[0], "what": parts[1] if len(parts) > 1 else "", "source": parts[2] if len(parts) > 2 else "", @@ -66,37 +86,26 @@ def settings(d): } -def rules_part(d, strict): - allow, block = read_dir(d / "allow"), read_dir(d / "block") - if strict: - block += read_dir(d / "optional") +def group_rules(d, groups): + """Allow rules plus every block/optional rule whose group is in groups.""" + allow = read_dir(d / "allow") + block = [r for kind in ("block", "optional") for r in read_dir(d / kind) if r["group"] in groups] rules = [rule(i + 100, r, False) for i, r in enumerate(allow)] rules += [rule(i + 200, r, True) for i, r in enumerate(block)] return {"numberRules": {"rules": rules}} -def type_files(d): - out = {} - allow = read_dir(d / "allow") - for kind in ("block", "optional"): - for f in sorted((d / kind).glob("*.txt")): - rs = read_rules(f) - rules = [rule(i + 100, r, False) for i, r in enumerate(allow)] - rules += [rule(i + 200, r, True) for i, r in enumerate(rs)] - out[f"types/{f.stem}"] = {"categories": {"all": ["REGEX_RULES"]}, "numberRules": {"rules": rules}} - return out - - def files(d): s = settings(d) - default, strict = rules_part(d, False), rules_part(d, True) - return { - "settings": s, - "rules-default": {"categories": {"all": ["REGEX_RULES"]}, **default}, - "rules-strict": {"categories": {"all": ["REGEX_RULES"]}, **strict}, - "complete": {**s, "categories": {"all": ["OTHERS", "REGEX_RULES"]}, **default}, - **type_files(d), + default = group_rules(d, DEFAULT_GROUPS) + out = { + "spamblocker-full-setup": {**s, "categories": {"all": ["OTHERS", "REGEX_RULES"]}, **default}, + "spamblocker-settings": s, + "spamblocker-all-rules": {"categories": {"all": ["REGEX_RULES"]}, **default}, } + for g in GROUPS: + out[f"spamblocker-{g}"] = {"categories": {"all": ["REGEX_RULES"]}, **group_rules(d, [g])} + return out def patterns_md(cc, d): @@ -111,10 +120,53 @@ def patterns_md(cc, d): return head + "\n".join(rows) + "\n" +def read_numbers(d): + f = d / "numbers" / "IN-REPORTED-BUSINESS.txt" + if not f.exists(): + return [] + return sorted({l.strip() for l in f.read_text(encoding="utf-8").splitlines() if l.strip() and not l.startswith("#")}) + + +def raw_rows(d): + rows = [] + for kind, prio in (("allow", ALLOW_PRIORITY), ("block", BLOCK_PRIORITY), ("optional", BLOCK_PRIORITY)): + for r in read_dir(d / kind): + rows.append({"type": kind, "id": r["id"], "kind": "pattern", "value": r["pattern"], + "description": r["what"], "source": r["source"], "priority": prio, "group": r["group"]}) + for n in read_numbers(d): + rows.append({"type": "block", "id": "IN-REPORTED-BUSINESS", "kind": "number", "value": n, + "description": "Business number reported as spam", "source": "community spam reports", + "priority": BLOCK_PRIORITY, "group": ""}) + return rows + + +COLS = ["type", "id", "kind", "value", "description", "source", "priority", "group"] + + +def raw_files(cc, d): + rows = raw_rows(d) + buf = io.StringIO(newline="") + w = csv.DictWriter(buf, fieldnames=COLS, lineterminator="\n") + w.writeheader() + w.writerows(rows) + meta = {"name": "SpamWall", "version": VERSION, "country": cc.upper(), + "matching": "national number without +91 or leading 0", "license": "MIT", "repo": REPO} + js = json.dumps({"meta": meta, "rules": rows}, indent=1, ensure_ascii=False) + "\n" + esc = lambda t: str(t).replace("|", "\\|") + md = ["", + f"# SpamWall {cc.upper()} raw list (v{VERSION})", "", + "Numbers are matched as the national number, without +91 or a leading 0. " + "Patterns are regular expressions; numbers are exact matches.", "", + "| " + " | ".join(COLS) + " |", "|" + "---|" * len(COLS)] + for r in rows: + v = f"`{esc(r['value'])}`" + md.append("| " + " | ".join([r["type"], r["id"], r["kind"], v, esc(r["description"]), esc(r["source"]), str(r["priority"]), r["group"]]) + " |") + return {f"spamwall-{cc}.csv": buf.getvalue(), f"spamwall-{cc}.json": js, f"spamwall-{cc}.md": "\n".join(md) + "\n"} + + def main(): OUT.mkdir(exist_ok=True) - (OUT / "types").mkdir(exist_ok=True) - for old in list(OUT.glob("spamwall-*")) + list((OUT / "types").glob("*")): + for old in OUT.glob("*"): old.unlink() for cc_dir in sorted(p for p in (ROOT / "rules").iterdir() if p.is_dir()): for name, obj in files(cc_dir).items(): @@ -123,6 +175,10 @@ def main(): with gzip.GzipFile(OUT / f"{name}.gz", "wb", mtime=0) as f: f.write(data.encode("utf-8")) print("built", name) + RAW.mkdir(exist_ok=True) + for name, text in raw_files(cc_dir.name, cc_dir).items(): + (RAW / name).write_text(text, encoding="utf-8", newline="\n") + print("built raw", name) (cc_dir / "patterns.md").write_text(patterns_md(cc_dir.name, cc_dir), encoding="utf-8", newline="\n") diff --git a/tools/check.py b/tools/check.py index d5bf536..5f11fe0 100644 --- a/tools/check.py +++ b/tools/check.py @@ -1,14 +1,21 @@ """CI checks: regexes compile, no allow/block overlap on official series, no personal-looking data, every pattern file is well formed, and generated files match the rule sources.""" -import json, re, subprocess, sys +import importlib.util, json, re, subprocess, sys from pathlib import Path ROOT = Path(__file__).resolve().parent.parent errors = [] ids = {} +group_of = {} +spec = importlib.util.spec_from_file_location("build", ROOT / "tools" / "build_spamblocker.py") +build = importlib.util.module_from_spec(spec) +spec.loader.exec_module(build) +GROUPS = build.GROUPS for txt in (ROOT / "rules").rglob("*.txt"): folder = txt.parent.name + if folder == "numbers": + continue n_rules = 0 text = txt.read_text(encoding="utf-8") for n, line in enumerate(text.splitlines(), 1): @@ -31,6 +38,14 @@ ids[parts[0]] = txt if folder == "block" and (re.match(s, "1600000000") or re.match(s, "1601000000")): errors.append(f"{txt}:{n} blocks an official 1600/1601 number") + if folder in {"block", "optional"}: + gm = re.search(r"^# Group:\s*(\S+)\s*$", text, re.M) + if not gm: + errors.append(f"{txt}: header comment missing '# Group: '") + elif gm.group(1) not in GROUPS: + errors.append(f"{txt}: unknown group {gm.group(1)}") + else: + group_of[txt.stem] = gm.group(1) if folder in {"allow", "block", "optional"}: if n_rules != 1: errors.append(f"{txt}: must hold exactly one pattern line") @@ -46,7 +61,7 @@ def gen(): - paths = [p for p in (ROOT / "spamblocker").rglob("*") if p.is_file()] + list((ROOT / "rules").rglob("patterns.md")) + paths = [p for p in (ROOT / "spamblocker").rglob("*") if p.is_file()] + list((ROOT / "rules").rglob("patterns.md")) + list((ROOT / "raw").rglob("*")) return {str(p.relative_to(ROOT)): p.read_bytes() for p in paths} @@ -55,7 +70,46 @@ def gen(): after = gen() if before != after: errors.append("generated files are out of date: run tools/build_spamblocker.py and commit") -d = json.loads((ROOT / "spamblocker" / "complete.json").read_text(encoding="utf-8")) +mobile = re.compile(r"^[6-9]\d{9}$") +for f in (ROOT / "rules" / "in" / "numbers").glob("*.txt"): + for n, line in enumerate(f.read_text(encoding="utf-8").splitlines(), 1): + s = line.strip() + if not s or s.startswith("#"): + continue + if not re.fullmatch(r"\d{4,11}", s): + errors.append(f"{f}:{n} not a valid number: {s}") + if mobile.match(s): + errors.append(f"{f}:{n} contains a 10-digit mobile number") +for f in (ROOT / "raw").glob("*"): + for n, line in enumerate(f.read_text(encoding="utf-8").splitlines(), 1): + if re.search(r"(? file (gz + json)") +allow_ids = {r["id"] for r in build.read_dir(ROOT / "rules" / "in" / "allow")} +for g in GROUPS: + want = {i for i, gg in group_of.items() if gg == g} + rr = json.loads((sb / f"spamblocker-{g}.json").read_text(encoding="utf-8"))["numberRules"]["rules"] + got_b = {m.group(1) for r in rr if r["isBlacklist"] for m in [re.match(r"SpamWall (\S+):", r["description"])] if m} + got_a = {m.group(1) for r in rr if not r["isBlacklist"] for m in [re.match(r"SpamWall (\S+):", r["description"])] if m} + if got_b != want or got_a != allow_ids or len(rr) != len(want) + len(allow_ids): + errors.append(f"spamblocker-{g}.json must hold exactly its block rules {sorted(want)} plus the allow rules") +d = json.loads((ROOT / "spamblocker" / "spamblocker-full-setup.json").read_text(encoding="utf-8")) rl = d["numberRules"]["rules"] shared = {r["priority"] for r in rl if r["isBlacklist"]} & {r["priority"] for r in rl if not r["isBlacklist"]} if shared: