From 16ef47ca1caf7d95bdc0cbaaf201ffee8d9da455 Mon Sep 17 00:00:00 2001 From: = <=> Date: Sun, 29 Oct 2023 00:50:04 +0200 Subject: [PATCH] bekkalokk added roundcube test --- hosts/bekkalokk/configuration.nix | 1 + hosts/bekkalokk/services/webmail/default.nix | 6 ++++ .../bekkalokk/services/webmail/roundcube.nix | 31 +++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 hosts/bekkalokk/services/webmail/default.nix create mode 100644 hosts/bekkalokk/services/webmail/roundcube.nix diff --git a/hosts/bekkalokk/configuration.nix b/hosts/bekkalokk/configuration.nix index 1c21b7b..e2d2891 100644 --- a/hosts/bekkalokk/configuration.nix +++ b/hosts/bekkalokk/configuration.nix @@ -13,6 +13,7 @@ # ./services/website.nix ./services/nginx.nix ./services/gitea/default.nix + ./services/webmail # ./services/mediawiki.nix ]; diff --git a/hosts/bekkalokk/services/webmail/default.nix b/hosts/bekkalokk/services/webmail/default.nix new file mode 100644 index 0000000..32b178e --- /dev/null +++ b/hosts/bekkalokk/services/webmail/default.nix @@ -0,0 +1,6 @@ +{ config, values, pkgs, ... }: +{ + imports = [ + ./roundcube.nix + ]; +} diff --git a/hosts/bekkalokk/services/webmail/roundcube.nix b/hosts/bekkalokk/services/webmail/roundcube.nix new file mode 100644 index 0000000..de0df2b --- /dev/null +++ b/hosts/bekkalokk/services/webmail/roundcube.nix @@ -0,0 +1,31 @@ +{ config, pkgs, lib, ... }: + +with lib; +let + cfg = config.services.roundcube; + domain = "webmail2.pvv.ntnu.no"; + # mailserver = config.mailserver.fqdn; + mailserver = "smtp.pvv.ntnu.no"; +in +{ + services.roundcube = { + enable = true; + package = pkgs.roundcube.withPlugins (plugins: [ plugins.persistent_login ]); + dicts = with pkgs.aspellDicts; [ en en-science en-computers nb nn fr de it nl pl is he gd fi es da am grc de-alt ]; + maxAttachmentSize = 20; + + # this is the url of the vhost, not necessarily the same as the fqdn of + # the mailserver + hostName = domain; + + extraConfig = '' + # starttls needed for authentication, so the fqdn required to match + # the certificate + $config['smtp_server'] = "tls://${mailserver}"; + $config['smtp_user'] = "%u"; + $config['smtp_pass'] = "%p"; + ''; + }; + + networking.firewall.allowedTCPPorts = [ 80 443 ]; +} \ No newline at end of file