2021-02-17 18:06:00 +01:00
|
|
|
{ config, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
(builtins.fetchTarball {
|
|
|
|
url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/nixos-20.09/nixos-mailserver-nixos-20.09.tar.gz";
|
|
|
|
sha256 = "0vsvgxxg5cgmzwj98171j7h5l028f1yq784alb3lxgbk8znfk51y";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
security.acme = {
|
|
|
|
email = "rnhmjoj@inventati.org";
|
|
|
|
acceptTerms = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
mailserver = {
|
|
|
|
enable = true;
|
|
|
|
fqdn = "mail.eurofusion.eu";
|
2021-03-07 12:24:03 +01:00
|
|
|
domains = [ "eurofusion.eu" ];
|
2021-02-17 18:06:00 +01:00
|
|
|
|
|
|
|
loginAccounts = config.secrets.emailAccounts;
|
|
|
|
|
|
|
|
extraVirtualAliases = {
|
|
|
|
"abuse@eurofusion.eu" = "rnhmjoj@eurofusion.eu";
|
|
|
|
};
|
|
|
|
|
2021-04-02 19:19:48 +02:00
|
|
|
mailboxes = {
|
|
|
|
# default IMAP folders
|
|
|
|
Sent = { specialUse = "Sent"; auto = "subscribe"; };
|
|
|
|
Drafts = { specialUse = "Drafts"; auto = "subscribe"; };
|
|
|
|
Spam = { specialUse = "Junk"; auto = "subscribe"; };
|
|
|
|
Trash = { specialUse = "Trash"; auto = "no"; };
|
|
|
|
};
|
|
|
|
|
2021-02-17 18:06:00 +01:00
|
|
|
# Use Let's Encrypt certificate
|
|
|
|
certificateScheme = 3;
|
|
|
|
|
|
|
|
# There is one already (pdns-recursor)
|
|
|
|
localDnsResolver = false;
|
|
|
|
|
|
|
|
# Enable IMAP, SMTP
|
|
|
|
enableImapSsl = true;
|
|
|
|
enableSubmissionSsl = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
services.dovecot2.extraConfig = ''
|
2021-03-07 12:24:03 +01:00
|
|
|
# Improve hashing speed
|
2021-02-17 18:06:00 +01:00
|
|
|
auth_cache_verify_password_with_worker = yes
|
|
|
|
'';
|
2021-03-07 12:24:03 +01:00
|
|
|
|
2021-02-17 18:06:00 +01:00
|
|
|
services.postfix.extraConfig = ''
|
2021-03-07 12:24:03 +01:00
|
|
|
# Prefer IPv6
|
2021-02-17 18:06:00 +01:00
|
|
|
smtp_address_preference = ipv6
|
2021-03-07 12:24:03 +01:00
|
|
|
# Prevent binding on temporary addresses
|
|
|
|
smtp_bind_address6 = 2001:470:c8e8:0:230:48ff:fefa:91e1
|
2021-02-17 18:06:00 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
}
|