From ba4b3829ddca1532135d871d8329e06df7e6c365 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Sat, 13 Oct 2018 21:06:46 +0200 Subject: Include automatix's mail server config --- host/software/server/mail.nix | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 host/software/server/mail.nix 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" + ''; + }; + }; +} -- cgit v1.2.3