配置
SystemMail 分文件配置、默认值与生效方式
配置
配置目录为 plugins/SystemMail/。SystemMail 按职责拆分配置,UI ID、服务端变量名和 handler
名称由代码固定,不需要服主重复填写。
config.yml
| 配置项 | 默认值 | 说明 | 生效 |
|---|---|---|---|
server-id | server-1 | 1–64 位字母、数字、.、_、-;每个子服唯一 | 重启 |
time-zone | Asia/Shanghai | Java ZoneId;所有子服保持一致 | 重启 |
database.yml
| 配置项 | 默认值 | 说明 | 生效 |
|---|---|---|---|
type | sqlite | sqlite 或 mysql | 重启 |
sqlite-file | system-mail.db | 相对插件目录的 SQLite 文件 | 重启 |
worker-threads | 4 | 后台邮件任务线程数,2–16 | 重启 |
mysql.host | 127.0.0.1 | MySQL 地址 | 重启 |
mysql.port | 3306 | 1–65535 | 重启 |
mysql.database | system_mail | 数据库名 | 重启 |
mysql.username | root | 用户名 | 重启 |
mysql.password | change-me | 密码,生产环境必须修改 | 重启 |
mysql.parameters | 见生成文件 | JDBC 参数,不带开头 ? | 重启 |
mysql.pool-size | 10 | 连接池上限,2–50 | 重启 |
SQLite 模式不能启用 Redis;MySQL 模式必须启用 Redis。
redis.yml
| 配置项 | 默认值 | 说明 | 生效 |
|---|---|---|---|
enabled | false | MySQL 多服必须为 true | 重启 |
host | 127.0.0.1 | Redis 地址 | 重启 |
port | 6379 | 1–65535 | 重启 |
username | '' | 空字符串表示不使用用户名 | 重启 |
password | '' | 空字符串表示不使用密码 | 重启 |
database | 0 | 0–15 | 重启 |
key-prefix | systemmail: | 多服保持一致,2–128 位安全字符 | 重启 |
通知频道固定为 <key-prefix>notifications。Redis 只负责快速通知,完整邮件与附件状态保存在数据库中。
mail.yml
| 配置项 | 默认值 | 说明 | 生效 |
|---|---|---|---|
notification-poll-seconds | 5 | 数据库检查新邮件间隔,1–60 秒 | 重启 |
limits.max-title-length | 64 | 1–256 | 重载 |
limits.max-content-length | 8192 | 1–32767 | 重载 |
limits.max-item-slots | 27 | 0–54 | 重载 |
limits.max-item-payload-bytes | 1048576 | 单件物品序列化上限,4096–8388608 | 重载 |
limits.max-mail-item-payload-bytes | 786432 | 整封邮件物品序列化总上限,65536–4194304 | 重载 |
limits.max-currencies | 16 | 0–64 | 重载 |
limits.max-currency-per-provider | 1000000000.0 | 单种货币最大正数金额 | 重载 |
limits.max-commands | 16 | 0–64 | 重载 |
limits.max-recipients-per-request | 10000 | 单次发送收件人数,1–250000 | 重载 |
limits.recipient-materialization-batch-rows | 5000 | 每批数据库写入行数,100–50000 | 重载 |
limits.max-admin-drafts | 500 | 全服共享草稿上限,1–5000 | 重载 |
limits.inbox-page-size | 20 | 每页邮件数,1–100 | 重载 |
limits.ui-claim-expiry-grace-minutes | 20 | 当前详情领取宽限,0–120 分钟 | 重载 |
retention.trashed-days | 30 | 已删除邮件关系和结束附件操作保留天数,1–3650 | 重载 |
retention.audit-days | 180 | 审计记录保留天数,30–3650 | 重载 |
retention.draft-attempt-days | 90 | 已结束发送尝试保留天数,7–3650 | 重载 |
retention.notification-hours | 48 | 通知、回执和失活游标保留小时,24–720 | 重载 |
maintenance.batch-rows | 5000 | 每类记录每轮清理行数,100–10000 | 重载 |
commands.allowed-prefixes | [] | 空列表禁止命令附件;单项最长 128 且不能换行 | 重载 |
命令白名单示例:
language.yml
language.yml 保存时间、附件名称和失败提示,可在线重载。
重载与重启
该命令重新读取 mail.yml、language.yml、ui/inbox.yml 和 ui/hud.yml。如果config.yml、database.yml、redis.yml 或notification-poll-seconds 改变,本次重载会失败并继续使用原设置,完整重启后生效。
配置模板只在对应文件不存在时释放。重载只读取当前文件,不会改写内容或自动增加字段。
不要使用 Bukkit /reload 或 PlugMan 热卸载 SystemMail。数据库、Redis 和共享运行库应随 服务器完整启动与关闭。
