summaryrefslogtreecommitdiff
path: root/host/software/server
diff options
context:
space:
mode:
Diffstat (limited to 'host/software/server')
-rw-r--r--host/software/server/mail.nix34
1 files changed, 34 insertions, 0 deletions
diff --git a/host/software/server/mail.nix b/host/software/server/mail.nix
new file mode 100644
index 0000000..ac65ef4
--- /dev/null
+++ b/host/software/server/mail.nix
@@ -0,0 +1,34 @@
+{ config, pkgs, ... }:
+
+{
+ imports = [
+ (builtins.fetchTarball "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/v2.1.4/nixos-mailserver-v2.1.4.tar.gz")
+ ];
+
+ mailserver = {
+ enable = true;
+ fqdn = "mx.kummerlaender.eu";
+ domains = [ "kummerlaender.eu" ];
+
+ loginAccounts = import ./mailusers.nix;
+
+ # Enable LetsEncrypt
+ certificateScheme = 3;
+
+ enableImap = true;
+ enableImapSsl = true;
+ };
+
+ systemd.services.fetchmail = {
+ enable = true;
+ after = [ "dovecot2.service" ];
+ wantedBy = [ "dovecot2.service" ];
+ serviceConfig = {
+ User = "virtualMail";
+ ExecStart = ''
+ ${pkgs.fetchmail}/bin/fetchmail --fetchmailrc /var/vmail/fetchmailrc \
+ --mda "${pkgs.dovecot}/libexec/dovecot/deliver -d adrian@kummerlaender.eu"
+ '';
+ };
+ };
+}