[GH-ISSUE #102] [FEATURE] Make adjective/noun word lists in generateRandomEmail() configurable #75

Open
opened 2026-02-25 23:39:47 +03:00 by kerem · 2 comments
Owner

Originally created by @Aejs on GitHub (Jul 4, 2025).
Original GitHub issue: https://github.com/HaschekSolutions/opentrashmail/issues/102

Summary:
Allow the adjective and noun word lists used in generateRandomEmail() to be loaded from external sources (e.g. text files or configuration), instead of being hardcoded in core.php.


Current Behavior:
The function generateRandomEmail() in web/inc/core.php uses hardcoded arrays of English adjectives and nouns to generate email names (e.g. fastcat42@domain.com).

This makes it difficult to:

  • Localize the email names (e.g. into German or French),
  • Apply custom branding or themes (e.g. tech terms, animal names),
  • Maintain changes without modifying core files (which can be overwritten on update).

Proposed Behavior:
Introduce a way to override the default word lists, for example:

  1. Load words from external .txt files:
    • adjectives.txt and nouns.txt in a configurable directory (e.g. web/inc/).
  2. Or: allow definitions via config.ini (comma-separated lists).
  3. If the external files do not exist, fallback to the default arrays (for backward compatibility).

Benefits:

  • Makes the project more flexible and user-friendly.
  • Enables localization and personalization without code changes.
  • Encourages wider adoption by making branding easier.

Example use cases:

  • A German trashmail instance wants to use schlau, groß, bär, ente.
  • A themed instance wants to use only tech terms: cyber, quantum, robot, script.
Originally created by @Aejs on GitHub (Jul 4, 2025). Original GitHub issue: https://github.com/HaschekSolutions/opentrashmail/issues/102 **Summary:** Allow the adjective and noun word lists used in `generateRandomEmail()` to be loaded from external sources (e.g. text files or configuration), instead of being hardcoded in `core.php`. --- **Current Behavior:** The function `generateRandomEmail()` in `web/inc/core.php` uses hardcoded arrays of English adjectives and nouns to generate email names (e.g. `fastcat42@domain.com`). This makes it difficult to: - Localize the email names (e.g. into German or French), - Apply custom branding or themes (e.g. tech terms, animal names), - Maintain changes without modifying core files (which can be overwritten on update). --- **Proposed Behavior:** Introduce a way to override the default word lists, for example: 1. Load words from external `.txt` files: - `adjectives.txt` and `nouns.txt` in a configurable directory (e.g. `web/inc/`). 2. Or: allow definitions via `config.ini` (comma-separated lists). 3. If the external files do not exist, fallback to the default arrays (for backward compatibility). --- **Benefits:** - Makes the project more flexible and user-friendly. - Enables localization and personalization without code changes. - Encourages wider adoption by making branding easier. --- **Example use cases:** - A German trashmail instance wants to use `schlau`, `groß`, `bär`, `ente`. - A themed instance wants to use only tech terms: `cyber`, `quantum`, `robot`, `script`.
Author
Owner

@geek-at commented on GitHub (Jul 8, 2025):

Hello! Good idea, maybe with a custom JSON or word list.

But to be clear: The "Generate" button does nothing except for load the page on that name. Does not prepare anything in a folder structure or databse.

You can use any email address without even using the GUI once. The server receives emails for all email addresses with the domains you have configured and you don't have to "pre-create" them

<!-- gh-comment-id:3049322786 --> @geek-at commented on GitHub (Jul 8, 2025): Hello! Good idea, maybe with a custom JSON or word list. But to be clear: The "Generate" button does nothing except for load the page on that name. Does not prepare anything in a folder structure or databse. You can use any email address without even using the GUI once. The server receives emails for all email addresses with the domains you have configured and you don't have to "pre-create" them
Author
Owner

@Aejs commented on GitHub (Jul 24, 2025):

Yeah that would be great. Yeah i know that u can use any name but it would be far more convenience to make a custom wordlist

<!-- gh-comment-id:3112205704 --> @Aejs commented on GitHub (Jul 24, 2025): Yeah that would be great. Yeah i know that u can use any name but it would be far more convenience to make a custom wordlist
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentrashmail#75
No description provided.