anchor.diff:              ${pkgs.postfix}/bin/postfix set-permissions config_directory=/var/lib/postfix/conf
             '';
           };
  +
  +      services.postfix.masterConfig = {
  +        smtp_inet = {
  +          name = "smtp";
  +          type = "inet";
  +          private = false;
  +          command = "smtpd";
  +        };
  +        pickup = {
  +          private = false;
  +          wakeup = 60;
  +          maxproc = 1;
  +        };
  +        cleanup = {
  +          private = false;
  +          maxproc = 0;
  +        };
  +        qmgr = {
  +          private = false;
  +          wakeup = 300;
  +          maxproc = 1;
  +        };
  +        tlsmgr = {
  +          wakeup = 1000;
  +          wakeupUnusedComponent = false;
  +          maxproc = 1;
  +        };
  +        rewrite = {
  +          command = "trivial-rewrite";
  +        };
  +        bounce = {
  +          maxproc = 0;
  +        };
  +        defer = {
  +          maxproc = 0;
  +          command = "bounce";
  +        };
  +        trace = {
  +          maxproc = 0;
  +          command = "bounce";
  +        };
  +        verify = {
  +          maxproc = 1;
  +        };
  +        flush = {
  +          private = false;
  +          wakeup = 1000;
  +          wakeupUnusedComponent = false;
  +          maxproc = 0;
  +        };
  +        proxymap = {
  +          command = "proxymap";
  +        };
  +        proxywrite = {
  +          maxproc = 1;
  +          command = "proxymap";
  +        };
  +        showq = {
  +          private = false;
  +        };
  +        error = {};
  +        retry = {
  +          command = "error";
  +        };
  +        discard = {};
  +        local = {
  +          privileged = true;
  +        };
  +        virtual = {
  +          privileged = true;
  +        };
  +        lmtp = {
  +        };
  +        anvil = {
  +          maxproc = 1;
  +        };
  +        scache = {
  +          maxproc = 1;
  +        };
  +      } // optionalAttrs cfg.enableSubmission {
  +        submission = {
  +          type = "inet";
  +          private = false;
  +          command = "smtpd";
  +          args = let
  +            mkKeyVal = opt: val: [ "-o" (opt + "=" + val) ];
  +          in concatLists (mapAttrsToList mkKeyVal cfg.submissionOptions);
  +        };
  +      } // optionalAttrs cfg.enableSmtp {
  +        smtp = {};
  +        relay = {
  +          command = "smtp";
  +          args = [ "-o" "smtp_fallback_relay=" ];
  +        };
  +      };
       }
   
       (mkIf haveAliases {
  
positive.code:         ";
        };
  
        extraConfig = mkOption {
          type = types.lines;
          default = "";
  
negative.code:         description = "
            Entries for the virtual alias map, cf. man-page virtual(8).
          ";
        };
  
        virtualMapType = mkOption {
          type = types.enum ["hash" "regexp" "pcre"];
          default = "hash";
          description = ''
            What type of virtual alias map file to use. Use <literal>"regexp"</literal> for regular expressions.
          '';
        };
  
        transport = mkOption {
  