diff options
author | Gabriel Ebner <gebner@gebner.org> | 2015-10-25 12:06:56 +0100 |
---|---|---|
committer | Gabriel Ebner <gebner@gebner.org> | 2015-10-26 11:46:17 +0100 |
commit | 929e734f19f6b3a4ff89fe87e0ff424bd70bb7c9 (patch) | |
tree | cdcf59091b6e8a5edc43a744a5cb38fa4e8da9b3 /nixos | |
parent | faa7561a664cec5d846315120b181802c9428d5c (diff) | |
download | nixlib-929e734f19f6b3a4ff89fe87e0ff424bd70bb7c9.tar nixlib-929e734f19f6b3a4ff89fe87e0ff424bd70bb7c9.tar.gz nixlib-929e734f19f6b3a4ff89fe87e0ff424bd70bb7c9.tar.bz2 nixlib-929e734f19f6b3a4ff89fe87e0ff424bd70bb7c9.tar.lz nixlib-929e734f19f6b3a4ff89fe87e0ff424bd70bb7c9.tar.xz nixlib-929e734f19f6b3a4ff89fe87e0ff424bd70bb7c9.tar.zst nixlib-929e734f19f6b3a4ff89fe87e0ff424bd70bb7c9.zip |
postfix: 2.11.5 -> 3.0.3
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/mail/postfix.nix | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/nixos/modules/services/mail/postfix.nix b/nixos/modules/services/mail/postfix.nix index e8beba4b3586..c9a5c2d1d61d 100644 --- a/nixos/modules/services/mail/postfix.nix +++ b/nixos/modules/services/mail/postfix.nix @@ -11,6 +11,8 @@ let mainCf = '' + compatibility_level = 2 + queue_directory = /var/postfix/queue command_directory = ${pkgs.postfix}/sbin daemon_directory = ${pkgs.postfix}/libexec/postfix @@ -31,10 +33,7 @@ let mynetworks_style = ${cfg.networksStyle} '' else - # Postfix default is subnet, but let's play safe - '' - mynetworks_style = host - '') + "") + optionalString (cfg.hostname != "") '' myhostname = ${cfg.hostname} '' @@ -89,7 +88,7 @@ let masterCf = '' # ========================================================================== # service type private unpriv chroot wakeup maxproc command + args - # (yes) (yes) (yes) (never) (100) + # (yes) (yes) (no) (never) (100) # ========================================================================== smtp inet n - n - - smtpd #submission inet n - n - - smtpd @@ -232,8 +231,7 @@ in default = null; example = ["localdomain"]; description = " - List of domains we agree to relay to. Default is the same as - destination. + List of domains we agree to relay to. Default is empty. "; }; @@ -357,23 +355,20 @@ in } ]; - jobs.postfix = - # I copy _lots_ of shipped configuration filed - # that can be left as is. I am afraid the exact - # will list slightly change in next Postfix - # release, so listing them all one-by-one in an - # accurate way is unlikely to be better. + systemd.services.postfix = { description = "Postfix mail server"; wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; - daemonType = "fork"; + serviceConfig = { + Type = "forking"; + Restart = "always"; + PIDFile = "/var/postfix/queue/pid/master.pid"; + }; preStart = '' - if ! [ -d /var/spool/postfix ]; then - ${pkgs.coreutils}/bin/mkdir -p /var/spool/mail /var/postfix/conf /var/postfix/queue - fi + ${pkgs.coreutils}/bin/mkdir -p /var/spool/mail /var/postfix/conf /var/postfix/queue ${pkgs.coreutils}/bin/chown -R ${user}:${group} /var/postfix ${pkgs.coreutils}/bin/chown -R ${user}:${setgidGroup} /var/postfix/queue @@ -382,7 +377,7 @@ in ${pkgs.coreutils}/bin/chmod a+rwxt /var/spool/mail ${pkgs.coreutils}/bin/ln -sf /var/spool/mail /var/mail - ln -sf "${pkgs.postfix}/etc/postfix/"* /var/postfix/conf + ln -sf ${pkgs.postfix}/etc/postfix/postfix-files /var/postfix/conf ln -sf ${aliasesFile} /var/postfix/conf/aliases ln -sf ${virtualFile} /var/postfix/conf/virtual @@ -391,12 +386,18 @@ in ${pkgs.postfix}/sbin/postalias -c /var/postfix/conf /var/postfix/conf/aliases ${pkgs.postfix}/sbin/postmap -c /var/postfix/conf /var/postfix/conf/virtual + ''; + script = '' ${pkgs.postfix}/sbin/postfix -c /var/postfix/conf start ''; + reload = '' + ${pkgs.postfix}/sbin/postfix -c /var/postfix/conf reload + ''; + preStop = '' - ${pkgs.postfix}/sbin/postfix -c /var/postfix/conf stop + ${pkgs.postfix}/sbin/postfix -c /var/postfix/conf stop ''; }; |