2023-06-28 16:54:50 -04:00
|
|
|
# This file should be copied to /etc/systemd/system/mail4one.service
|
|
|
|
# Quickstart
|
|
|
|
# systemctl daemon-reload
|
|
|
|
# systemctl enable --now mail4one.service
|
2023-06-20 21:45:14 -04:00
|
|
|
|
|
|
|
[Unit]
|
|
|
|
Description=Personal Mail server
|
|
|
|
Documentation=https://gitea.balki.me/balki/mail4one
|
|
|
|
After=network.target network-online.target
|
|
|
|
Requires=network-online.target
|
|
|
|
|
|
|
|
[Service]
|
2023-06-28 16:54:50 -04:00
|
|
|
|
|
|
|
# This user should already exist. See mail4one.conf for creating user with sysusers
|
2023-06-20 21:45:14 -04:00
|
|
|
User=mail4one
|
|
|
|
ExecStart=/usr/local/bin/mail4one --config /etc/mail4one/config.json
|
2023-06-24 21:17:47 -04:00
|
|
|
|
2023-06-28 16:54:50 -04:00
|
|
|
# Below allows to bind to port < 1024. Standard ports are 25, 465, 995
|
2023-06-20 21:45:14 -04:00
|
|
|
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
2023-06-24 21:17:47 -04:00
|
|
|
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
|
2023-06-20 21:45:14 -04:00
|
|
|
|
2023-06-24 20:12:20 -04:00
|
|
|
StateDirectory=mail4one/certs mail4one/mails
|
|
|
|
StateDirectoryMode=0750
|
2023-06-20 21:45:14 -04:00
|
|
|
LogsDirectory=mail4one
|
|
|
|
WorkingDirectory=/var/lib/mail4one
|
2023-06-24 20:12:20 -04:00
|
|
|
|
|
|
|
ProtectSystem=strict
|
|
|
|
PrivateTmp=true
|
2023-06-20 21:45:14 -04:00
|
|
|
ProtectHome=yes
|
2023-06-24 21:17:47 -04:00
|
|
|
ProtectProc=invisible
|
2023-06-28 16:54:50 -04:00
|
|
|
NoNewPrivileges=yes
|
2023-06-20 21:45:14 -04:00
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|