{ config, lib, ... }: with lib; let cfg = config.modules.services.dovecot; in { options.modules.services.dovecot = { enable = mkEnableOption "dovecot"; }; config = mkIf cfg.enable { services.dovecot2 = { enable = true; }; networking.firewall.allowedTCPPorts = [ 587 465 ]; }; }