{ config, lib, ... }: 
{
  config = lib.mkIf config.services.mailserver.enable {
    services.roundcube = {
      enable = true;
      hostName = "mail.nixfox.ca";
      extraConfig = ''
        $config['smtp_server'] = "tls://mx.nixfox.ca";
        $config['smtp_user'] = "%u";
        $config['smtp_pass'] = "%p";
      '';
    };

    environment.persistence."/persist".directories = [ "/var/lib/roundcube" ];
  };
}
