anchor.diff:        default = false;
         description = "Show the PAM failure message on authentication error (useful for OTPW).";
       };
  +
  +    mailboxes = mkOption {
  +      type = types.listOf (types.submodule mailboxes);
  +      default = [];
  +      example = [ { name = "Spam"; specialUse = "Junk"; auto = "create"; } ];
  +      description = "Configure mailboxes and auto create or subscribe them.";
  +    };
  +
  +    enableQuota = mkOption {
  +      type = types.bool;
  +      default = false;
  +      example = true;
  +      description = "Whether to enable the dovecot quota service.";
  +    };
  +
  +    quotaPort = mkOption {
  +      type = types.str;
  +      default = "12340";
  +      description = ''
  +        The Port the dovecot quota service binds to.
  +        If using postfix, add check_policy_service inet:localhost:12340 to your smtpd_recipient_restrictions in your postfix config.
  +      '';
  +    };
  +    quotaGlobalPerUser = mkOption {
  +      type = types.str;
  +      default = "100G";
  +      example = "10G";
  +      description = "Quota limit for the user in bytes. Supports suffixes b, k, M, G, T and %.";
  +    };
  +
     };
   
   
  
positive.code:       }
      '')
  
      cfg.extraConfig
    ];
  
  
negative.code:     paths = map (pkg: "${pkg}/lib/dovecot") ([ dovecotPkg ] ++ map (module: module.override { dovecot = dovecotPkg; }) cfg.modules);
    };
  
    mailboxConfig = mailbox: ''
      mailbox ${mailbox.name} {
        auto = ${toString mailbox.auto}
    '' + optionalString (mailbox.specialUse != null) ''
        special_use = \${toString mailbox.specialUse}
    '' + "}";
  
    mailboxes = { lib, pkgs, ... }: {
      options = {
        name = mkOption {
          type = types.str;
          example = "Spam";
          description = "The name of the mailbox.";
        };
        auto = mkOption {
          type = types.enum [ "no" "create" "subscribe" ];
          default = "no";
          example = "subscribe";
          description = "Whether to automatically create or create and subscribe to the mailbox or not.";
        };
        specialUse = mkOption {
          type = types.nullOr (types.enum [ "All" "Archive" "Drafts" "Flagged" "Junk" "Sent" "Trash" ]);
          default = null;
          example = "Junk";
          description = "Null if no special use flag is set. Other than that every use flag mentioned in the RFC is valid.";
        };
      };
    };
  in
  {
  
  