RedM documentation
Murphy's Telegram & Mail
Advanced
Player Home Mailboxes
murphy_post allows other resources (housing, camps, admin tools...) to register physical mailbox props in the world, tied to a specific player. Players can then check their personal inbox directly from home.
Configuration
In config/config.lua:
Exports API
All exports are server-side only.
RegisterPlayerMailbox
Registers a new mailbox. A prop is spawned client-side and an interaction point is created automatically.
Parameters:
| Field | Type | Required | Description |
|---|---|---|---|
coords |
{x, y, z} |
Yes | World position for the prop |
heading |
number |
No | Prop heading in degrees (default: 0) |
propModel |
string |
No | RedM prop model name (default: p_mailbox01x) |
ownerIdentifier |
string/number |
Yes | Character identifier of the mailbox owner |
label |
string |
No | Display name shown in the interaction |
externalId |
string |
No | Your own unique identifier for later retrieval/removal |
Error codes: no_data, missing_coords, invalid_coords, missing_owner_identifier, duplicate_external_id, db_insert_failed
UnregisterPlayerMailbox
Removes a mailbox. The prop is despawned and the interaction removed for all players.
GetPlayerMailboxes
Returns a list of registered mailboxes. Optionally filter by owner.
How it works
- Registered mailboxes are persisted in the database (
post_player_mailboxestable) and survive server restarts. - On resource start, all mailboxes are loaded from DB and synced to connected players.
- When a player is within
Config.PlayerMailboxStreamDistance, the prop is spawned and an interaction point is created. - Clicking the interaction opens the player's personal inbox (same as at a post office).
- If
Config.PlayerMailboxSendEnabled = true, the full postal UI opens (send + receive). Iffalse, only the inbox is shown. - The inbox is tied to the interacting player, not the mailbox owner. This means anyone can click the mailbox, but they will only see their own inbox (server-side filtering).
Integration examples
Housing resource
When a player buys a house:
When a player sells/loses the house:
Admin command
See the full example resource in examples/murphy_post_mailbox_example/ which provides:
/createmailbox [label]- Creates a mailbox at your current position/removemailbox [id]- Removes a mailbox by its database ID/mymailboxes- Lists your registered mailboxes
To use it, copy the murphy_post_mailbox_example folder to your server's resources directory and add it to your server.cfg.
Discord Webhook
When Config.DiscordWebhook is set, a Discord notification is sent each time a new mailbox is registered via RegisterPlayerMailbox. The embed includes the owner name, label, and coordinates.
Database
The post_player_mailboxes table is auto-created on first startup. Schema:
Last updated: April 7, 2026