1[Unit]2Description=maddy mail server3Documentation=man:maddy(1)4Documentation=man:maddy.conf(5)5Documentation=https://maddy.email6After=network-online.target78[Service]9Type=notify10NotifyAccess=main1112User=maddy13Group=maddy1415# cd to state directory to make sure any relative paths16# in config will be relative to it unless handled specially.17WorkingDirectory=/var/lib/maddy1819ConfigurationDirectory=maddy20RuntimeDirectory=maddy21StateDirectory=maddy22LogsDirectory=maddy23ReadOnlyPaths=/usr/lib/maddy24ReadWritePaths=/var/lib/maddy2526# Strict sandboxing. You have no reason to trust code written by strangers from GitHub.27PrivateTmp=true28ProtectHome=true29ProtectSystem=strict30ProtectKernelTunables=true31ProtectHostname=true32ProtectClock=true33ProtectControlGroups=true34RestrictAddressFamilies=AF_UNIX AF_INET AF_INET63536# Additional sandboxing. You need to disable all of these options37# for privileged helper binaries (for system auth) to work correctly.38NoNewPrivileges=true39PrivateDevices=true40DeviceAllow=/dev/syslog41RestrictSUIDSGID=true42ProtectKernelModules=true43MemoryDenyWriteExecute=true44RestrictNamespaces=true45RestrictRealtime=true46LockPersonality=true4748# Graceful shutdown with a reasonable timeout.49TimeoutStopSec=7s50KillMode=mixed51KillSignal=SIGTERM5253# Required to bind on ports lower than 1024.54AmbientCapabilities=CAP_NET_BIND_SERVICE55CapabilityBoundingSet=CAP_NET_BIND_SERVICE5657# Force all files created by maddy to be only readable by it58# and maddy group.59UMask=00076061# Bump FD limitations. Even idle mail server can have a lot of FDs open (think62# of idle IMAP connections, especially ones abandoned on the other end and63# slowly timing out).64LimitNOFILE=1310726566# Limit processes count to something reasonable to67# prevent resources exhausting due to big amounts of helper68# processes launched.69LimitNPROC=5127071# Restart server on any problem.72Restart=on-failure73# ... Unless it is a configuration problem.74RestartPreventExitStatus=27576ExecStart=/usr/local/bin/maddy run7778ExecReload=/bin/kill -USR1 $MAINPID79ExecReload=/bin/kill -USR2 $MAINPID8081[Install]82WantedBy=multi-user.target