Show us your Workflows

## Blocked email domains sync

Disposable email addresses are a common path for spam signups and throwaway accounts. Discourse already has a `blocked_email_domains` setting for this, but the community list at [disposable-email-domains](GitHub - disposable-email-domains/disposable-email-domains: a list of disposable email domains · GitHub) is around 10,000 domains — far too large to maintain by pasting into the admin UI.

We also found that an older paste of that list had a hidden carriage return stuck on almost every entry, so Discourse was only matching a handful of domains. This workflow rebuilds a clean `|`-joined value every week from upstream, keeps a few privacy-alias domains and major providers unblocked, and only writes when something actually changed.

Here is the source for the workflow:

source on GitHub: GitHub - hhftechnology/discourse-workflow-blocked-email-domains: Discourse Workflows: keep blocked_email_domains synced with the disposable-email-domains list · GitHub

### Installation

1. Download the workflow source from the link above.

2. Navigate to the “Workflows” page in your forum’s admin interface (`/admin/plugins/discourse-workflows/workflows`).

3. Click the “+ New workflow” button.

A new workflow will be created and open.

4. Click the ⋮ button at the top right hand corner of the workflow canvas.

A menu will open.

5. Select “Import” from the menu.

The “Open” dialog will open.

6. Select the `blocked-email-domains-sync.json` file from the dialog.

7. Click the “Open” button in the dialog.

The workflow content will be added.

8. Follow the additional instructions provided in the “sticky note” you will now see in the workflow canvas.

### How it works

1. **Monday 04:30** (cron, in the workflow timezone) starts the run.

2. **Fetch upstream list** downloads `disposable_email_blocklist.conf` from GitHub. No API key.

3. **Build list** lowercases and trims, drops blanks and comments, adds your optional `EXTRAS`, removes `EXCLUDE` (defaults: `simplelogin.com`, `passmail.net`) and a `SAFE` list of major providers, keeps valid hostnames only, de-duplicates, sorts, and joins with `|`. It aborts without writing if upstream looks truncated or has fewer than 5,000 entries.

4. **Changed?** continues only when the built value differs from the current setting (including leftover whitespace).

5. **Save blocked_email_domains** uses the plugin’s Site setting node as `system`, so no admin API key is needed.

6. **Verify** reads the setting back and confirms it matches.

7. **Alert: list changed** (optional) posts a short summary to the chat channel in the global `$vars.alerts_channel` variable — create that variable, or delete the Alert node.

On a ~10k-domain list this runs in about 330–490 ms wall time, with about 33–51 ms of code time against the 1000 ms limit.

The first run can add thousands of domains. Run it once by hand, check Executions, then publish. The setting is under Admin → Settings → `blocked_email_domains`.

Update— Week 3

2 לייקים