Skip to content

Cross-Server Mail

Mail works across multiple servers. Set up a shared database, add a message bus, and players can send mail to anyone on any server. If the recipient’s online — even on a different server — they get notified instantly.


You’ll need three things:

  1. Shared database — MongoDB or MariaDB. All servers must point to the same instance. SQLite won’t work here because it’s a local file.
  2. Message bus — Redis or NATS. This is how servers tell each other about new mail in real time.
  3. Unique serverId — Each server needs a distinct identifier so the message bus routes notifications correctly.

All cross-server configuration lives in Ceremony’s config, not Courier’s.

File: config/ceremony/config.conf (on each server)


Point all servers at the same database.

MongoDB:

storageType = MONGO_DB
storageUrl = "mongodb://localhost:27017"

MariaDB:

storageType = MARIA_DB
storageUrl = "jdbc:mariadb://localhost:3306/courier"

messageBus {
type = REDIS
serverId = "lobby-1"
redisAddress = "redis://your-redis-host:6379"
redisPassword = ""
}
messageBus {
type = NATS
serverId = "survival-1"
natsAddress = "nats://your-nats-host:4222"
}

  1. A player sends mail on Server A
  2. The mail is stored in the shared database immediately
  3. A notification goes out on the message bus
  4. If the recipient’s online on Server B, they get notified instantly
  5. If they’re offline, they’ll hear about it when they next log in on any server

Mail is written to the database first, so nothing’s lost even if the message bus goes down temporarily. The bus is only for real-time notifications — the mail itself is always safe.


Rate limits are shared across servers when you’re using a shared database. If a player sends 5 messages on Server A, that counts toward their limit on Server B too. No bypassing limits by server-hopping.


Running one server? You don’t need any of this. The defaults work out of the box:

messageBus {
type = NONE
}

ProblemWhat to Check
Mail not appearing on other serversVerify all servers point to the same database URL and credentials
No real-time notifications across serversCheck that the message bus type, address, and credentials match on all servers
Duplicate or missing notificationsConfirm every server has a unique serverId
Connection refused errorsMake sure your database and message bus hosts are reachable from all server machines
Rate limits not sharedYou’re probably still on SQLite — switch to MongoDB or MariaDB