[Unit]
Description=Rizoma Mail Server (maild)
Documentation=https://rizomarl.com/docs
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=maild
Group=maild
WorkingDirectory=/var/lib/rizoma-mail
EnvironmentFile=-/etc/rizoma/maild.env
ExecStart=/opt/rizoma-mail/bin/maild serve
Restart=on-failure
RestartSec=5s
KillSignal=SIGINT
TimeoutStopSec=30s

AmbientCapabilities=CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
NoNewPrivileges=true
PrivateTmp=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
RestrictSUIDSGID=true
LockPersonality=true
MemoryDenyWriteExecute=true
ProtectSystem=full
ReadWritePaths=/var/lib/rizoma-mail /var/mail/rizoma /var/log/rizoma-mail /run

[Install]
WantedBy=multi-user.target
