anchor.diff:        base_dir = ${baseDir}
         protocols = ${concatStringsSep " " cfg.protocols}
         sendmail_path = /run/wrappers/bin/sendmail
  +      # defining mail_plugins must be done before the first protocol {} filter because of https://doc.dovecot.org/configuration_manual/config_file/config_file_syntax/#variable-expansion
  +      mail_plugins = $mail_plugins ${concatStringsSep " " cfg.mailPlugins.globally.enable}
       ''
  +
  +    (concatStringsSep "\n" (mapAttrsToList (protocol: plugins: ''
  +      protocol ${protocol} {
  +        mail_plugins = $mail_plugins ${concatStringsSep " " plugins.enable}
  +      }
  +    '') cfg.mailPlugins.perProtocol))
   
       (if cfg.sslServerCert == null then ''
         ssl = no
  
positive.code:      optional cfg.enableImap "imap"
       ++ optional cfg.enablePop3 "pop3"
       ++ optional cfg.enableLmtp "lmtp";
  
      users.users = {
        dovenull =
  
negative.code:     '')
  
      (optionalString cfg.enableQuota ''
        service quota-status {
          executable = ${dovecotPkg}/libexec/dovecot/quota-status -p postfix
          inet_listener {
            port = ${cfg.quotaPort}
          }
          client_limit = 1
        }
  
        plugin {
  