1[Unit]2Description=maddy mail server (using %i.conf)3Documentation=man:maddy(1)4Documentation=man:maddy.conf(5)5Documentation=https://maddy.email6After=network-online.target78[Service]9Type=notify10NotifyAccess=main1112User=maddy13Group=maddy1415ConfigurationDirectory=maddy16RuntimeDirectory=maddy17StateDirectory=maddy18LogsDirectory=maddy19ReadOnlyPaths=/usr/lib/maddy20ReadWritePaths=/var/lib/maddy2122# Strict sandboxing. You have no reason to trust code written by strangers from GitHub.23PrivateTmp=true24PrivateHome=true25ProtectSystem=strict26ProtectKernelTunables=true27ProtectHostname=true28ProtectClock=true29ProtectControlGroups=true30RestrictAddressFamilies=AF_UNIX AF_INET AF_INET631DeviceAllow=/dev/syslog3233# Additional sandboxing. You need to disable all of these options34# for privileged helper binaries (for system auth) to work correctly.35NoNewPrivileges=true36PrivateDevices=true37RestrictSUIDSGID=true38ProtectKernelModules=true39MemoryDenyWriteExecute=true40RestrictNamespaces=true41RestrictRealtime=true42LockPersonality=true4344# Graceful shutdown with a reasonable timeout.45TimeoutStopSec=7s46KillMode=mixed47KillSignal=SIGTERM4849# Required to bind on ports lower than 1024.50AmbientCapabilities=CAP_NET_BIND_SERVICE51CapabilityBoundingSet=CAP_NET_BIND_SERVICE5253# Force all files created by maddy to be only readable by it and54# maddy group.55UMask=00075657# Bump FD limitations. Even idle mail server can have a lot of FDs open (think58# of idle IMAP connections, especially ones abandoned on the other end and59# slowly timing out).60LimitNOFILE=1310726162# Limit processes count to something reasonable to63# prevent resources exhausting due to big amounts of helper64# processes launched.65LimitNPROC=5126667# Restart server on any problem.68Restart=on-failure69# ... Unless it is a configuration problem.70RestartPreventExitStatus=27172ExecStart=/usr/local/bin/maddy --config /etc/maddy/%i.conf run7374ExecReload=/bin/kill -USR1 $MAINPID75ExecReload=/bin/kill -USR2 $MAINPID7677[Install]78WantedBy=multi-user.target