nix-conf/systems/hetzner/mail.nix

88 lines
2 KiB
Nix
Raw Permalink Normal View History

2024-07-10 23:02:54 +02:00
{
config,
pkgs,
lib,
...
}:
2024-04-20 10:11:36 +02:00
{
mailserver = {
enable = true;
fqdn = "mail.missing.ninja";
2024-07-10 23:02:54 +02:00
domains = [
"missing.ninja"
"joens.zone"
"joens.website"
"joens.site"
"joens.online"
"joens.link"
"joens.international"
"joens.family"
"joens.digital"
"joens.blog"
"net0loggy.net"
"clan-war.net"
"net0loggy.de"
"dtg-c.de"
"joens.email"
];
2024-04-20 10:11:36 +02:00
# A list of all login accounts. To create the password hashes, use
# nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt'
loginAccounts = {
2024-04-22 15:22:21 +02:00
"jopejoe1@missing.ninja" = {
hashedPassword = "$2b$05$ZZk/X.gQqjRc08ej9XTuaO0aVnWjPGWUqo/xYGxHGsMEyDL.Hr8AS";
2024-07-10 23:02:54 +02:00
aliases = [
"@missing.ninja"
"@joens.zone"
"@joens.website"
"@joens.site"
"@joens.online"
"@joens.link"
"@joens.international"
"@joens.family"
"@joens.digital"
"@joens.blog"
"@net0loggy.net"
"@clan-war.net"
"@net0loggy.de"
"@dtg-c.de"
"@joens.email"
];
2024-04-20 10:11:36 +02:00
};
};
2024-04-20 10:31:33 +02:00
fullTextSearch = {
enable = true;
# index new email as they arrive
autoIndex = true;
# this only applies to plain text attachments, binary attachments are never indexed
indexAttachments = true;
enforced = "body";
};
2024-04-20 10:11:36 +02:00
# Use Let's Encrypt certificates. Note that this needs to set up a stripped
# down nginx and opens port 80.
certificateScheme = "acme-nginx";
};
2024-04-20 10:31:33 +02:00
services.roundcube = {
2024-07-10 23:02:54 +02:00
enable = true;
# this is the url of the vhost, not necessarily the same as the fqdn of
# the mailserver
hostName = "webmail.missing.ninja";
extraConfig = ''
# starttls needed for authentication, so the fqdn required to match
# the certificate
$config['smtp_server'] = "tls://${config.mailserver.fqdn}";
$config['smtp_user'] = "%u";
$config['smtp_pass'] = "%p";
'';
2024-04-20 10:31:33 +02:00
};
2024-07-10 23:02:54 +02:00
networking.firewall.allowedTCPPorts = [
80
443
];
2024-04-20 10:11:36 +02:00
}