|
692 | 692 |
|
693 | 693 | environment.etc."dovecot/dovecot.conf".source = cfg.configFile; |
694 | 694 |
|
695 | | - systemd.services.dovecot = { |
696 | | - aliases = [ "dovecot2.service" ]; |
| 695 | + systemd.services.dovecot2 = { |
697 | 696 | description = "Dovecot IMAP/POP3 server"; |
698 | | - documentation = [ |
699 | | - "man:dovecot(1)" |
700 | | - "https://doc.dovecot.org" |
701 | | - ]; |
702 | 697 |
|
703 | 698 | after = [ "network.target" ]; |
704 | 699 | wantedBy = [ "multi-user.target" ]; |
705 | | - restartTriggers = [ cfg.configFile ]; |
| 700 | + restartTriggers = [ |
| 701 | + cfg.configFile |
| 702 | + ]; |
706 | 703 |
|
707 | 704 | startLimitIntervalSec = 60; # 1 min |
708 | 705 | serviceConfig = { |
709 | 706 | Type = "notify"; |
710 | 707 | ExecStart = "${dovecotPkg}/sbin/dovecot -F"; |
711 | 708 | ExecReload = "${dovecotPkg}/sbin/doveadm reload"; |
712 | | - |
713 | | - CapabilityBoundingSet = [ |
714 | | - "CAP_CHOWN" |
715 | | - "CAP_DAC_OVERRIDE" |
716 | | - "CAP_FOWNER" |
717 | | - "CAP_NET_BIND_SERVICE" |
718 | | - "CAP_SETGID" |
719 | | - "CAP_SETUID" |
720 | | - "CAP_SYS_CHROOT" |
721 | | - "CAP_SYS_RESOURCE" |
722 | | - ]; |
723 | | - LockPersonality = true; |
724 | | - MemoryDenyWriteExecute = true; |
725 | | - NoNewPrivileges = true; |
726 | | - OOMPolicy = "continue"; |
727 | | - PrivateTmp = true; |
728 | | - ProcSubset = "pid"; |
729 | | - ProtectClock = true; |
730 | | - ProtectControlGroups = true; |
731 | | - ProtectHome = lib.mkDefault false; |
732 | | - ProtectHostname = true; |
733 | | - ProtectKernelLogs = true; |
734 | | - ProtectKernelModules = true; |
735 | | - ProtectKernelTunables = true; |
736 | | - ProtectProc = "invisible"; |
737 | | - ProtectSystem = "full"; |
738 | | - PrivateDevices = true; |
739 | 709 | Restart = "on-failure"; |
740 | 710 | RestartSec = "1s"; |
741 | | - RestrictAddressFamilies = [ |
742 | | - "AF_INET" |
743 | | - "AF_INET6" |
744 | | - "AF_UNIX" |
745 | | - ]; |
746 | | - RestrictNamespaces = true; |
747 | | - RestrictRealtime = true; |
748 | | - RestrictSUIDSGID = false; # sets sgid on maildirs |
749 | 711 | RuntimeDirectory = [ "dovecot2" ]; |
750 | | - SystemCallArchitectures = "native"; |
751 | | - SystemCallFilter = [ |
752 | | - "@system-service @resources" |
753 | | - "~@privileged" |
754 | | - "@chown @setuid capset chroot" |
755 | | - ]; |
756 | 712 | }; |
757 | 713 |
|
758 | 714 | # When copying sieve scripts preserve the original time stamp |
|
0 commit comments