Skip to content

Configuration

SR Mail uses a modular multi-file config system designed to survive updates cleanly.

text
config/
├── _default.lock/     # NEVER edit — overwritten on updates
│   ├── _init.lua      # Config = {} bootstrap
│   ├── global.lua     # Logging, locale, framework, limits, admin
│   ├── items.lua      # Item names, prices, tokens
│   ├── mailbox.lua    # Registration costs, limits, auto-generation
│   ├── discord.lua    # Webhook URL, embed color
│   ├── display.lua    # HUD icon, prompts, bird animation, mailbox props
│   ├── locations.lua  # Towns, telegraph offices
│   └── stamps_parcels.lua  # Stamp reqs, parcel limits, pricing
└── custom/            # YOUR overrides go here
    └── README.md

How to customize

  1. Find the config file in _default.lock/ with the setting you want to change.
  2. Copy it into custom/ (same filename).
  3. Edit only the values you want to change.
  4. Restart the resource or run /refresh.

Important rules

  • The entire file is replaced — not merged. Copy the whole file, then change values.
  • Only copy files you need to change — unchanged files keep their defaults.
  • Never edit files inside _default.lock/ — those will be overwritten on updates.
  • On updates, new config options appear in _default.lock/ automatically; copy the updated file to custom/ and re-apply your changes.

Example

To change the mail cooldown and locale:

  1. Copy _default.lock/global.luacustom/global.lua
  2. Edit custom/global.lua:
lua
Config.MailSendCooldown = 30  -- Changed from 0 to 30 seconds
Config.Locale = "de"          -- Changed from "en" to "de"
  1. Restart the resource.

Config reference

global.lua

KeyDefaultDescription
LogVerbosity"WARN""NONE" / "INFO" / "WARN" / "ERROR"
Locale"en"Locale key in locales/
FrameworkName"VORP""VORP" / "RedEM" / "QBR" / "Standalone"
CharIdentifierField"charidentifier"Character ID column
EnableMailCommandfalseAllow /mail outside Post Office
MailSendCooldown0Seconds between sends (0 = no limit)
MaxMailSubjectLength300Max subject characters
MaxMailBodyLength4000Max body characters
MaxAddressBookEntries500Max contacts per address book
AdminACEPermission"srmail.admin"ACE node for admin commands
LogAdminActionstrueLog admin actions to Discord

items.lua

KeyDefaultDescription
RequiredItem"telegram_voucher"Item for /mail away from Post Office
AddressBookItem"address_book"Address book item name
TelegramVoucherPrice2.00Cost to buy a voucher
AddressBookReplacementPrice5.00Cost to buy replacement address book
PersonalMailboxChangeToken"mailbox_change_token"Token for personal mailbox change
GroupMailboxChangeToken"group_mailbox_token"Token for group mailbox change

mailbox.lua

KeyDefaultDescription
AutoGenerateMailboxtrueAuto-assign numeric addresses
StartingMailboxNumber1000First auto-generated number
MailboxRegistrationCost10.00Personal mailbox fee
PersonalMailboxChangeCost25.00Fee to change personal address
GroupMailboxCost50.00Group mailbox registration fee
GroupMailboxChangeCost50.00Fee to change group address
MaxGroupMailboxesPerPlayer3Max owned group mailboxes
MaxGroupMembers10Max members per group mailbox

display.lua

KeyDefaultDescription
UsePromptstrueUse RedM interaction prompts
PromptKeynilCustom control hash (nil = default E key)
CheckMailInterval60000Unread poll interval (ms)
EnableUnreadPollingtrueBackground unread polling
NotificationDuration5000Toast notification duration (ms)
ShowMailIcontruePersistent HUD mail icon
MailIconPosition{0.95, 0.02}Icon screen position
MailIconSize0.020Icon scale
EnableBirdAnimationfalseBird send animation
MailBirdModel"A_C_PIGEON"Bird model for animation
UseHUDIntegrationfalsePush counts to external HUD
HUDExportName""HUD export resource name
HUDMailCountEvent""HUD event name
EnableMailboxPropstrueWorld prop detection
MailboxPropPromptDistance2.0Prop interaction range
MailboxPropPromptLabel"Check for mail"Prop prompt text
MailboxPropNames(table)Prop model names for detection

Reference: Keybind Hash Lookup

stamps_parcels.lua

KeyDefaultDescription
EnableStampstrueEnable stamp system
RequireStampstrueRequire stamps to send
EnableParcelstrueEnable parcel system
ParcelUseWeighttrueWeight-based (true) or slot-based (false)
ParcelMaxWeight15.0Max parcel weight (lbs)
ParcelMaxSlots10Max parcel slots
ParcelExpirationDays7Days before uncollected return
ParcelExpirationHours96Hours before parcel expires
ParcelReturnFee0.50Auto-return fee
ParcelBasePrice5.0Base send cost
ParcelPricePerItem0.5Per-item cost
ParcelPricePerPound0.5Per-pound cost
ParcelBlacklistedItems(table)Items barred from parcels

discord.lua

KeyDefaultDescription
EnableDiscordLogstrueEnable webhook logging
DiscordWebhook(URL)Discord webhook URL
DiscordColor15844367Embed color (decimal)

Reference: Discord Color code generator

locations.lua

KeyDefaultDescription
Towns(table)Town coordinates for location stamps
MaxTownDistance500.0Max units from town center
TelegraphOffices(table)Post office locations, blips, service flags

Localization

  • Set locale in config/_default.lock/global.lua or config/custom/global.lua: Config.Locale = "en"
  • Locale string tables are in locales/ (default: locales/en.lua).
  • Processing functions are in locales/localizer.lua.

Adding a new language

  1. Create a new file in locales/ (e.g. locales/es.lua) and define SRMailLuaLocale.data.es.
  2. Set Config.Locale = "es" in your config.
  3. Add the new locale file to shared_scripts in fxmanifest.lua before locales/localizer.lua.