2024-08-30 01:17:50 -04:00
|
|
|
{pkgs, outputs, ...}: rec {
|
2024-08-24 22:16:51 -04:00
|
|
|
# Mail server
|
|
|
|
mailserver = rec {
|
|
|
|
enable = true;
|
|
|
|
enableManageSieve = true;
|
2024-08-30 01:17:50 -04:00
|
|
|
domains = [ "${outputs.secrets.jimDomain}" ];
|
|
|
|
fqdn = "mx.${outputs.secrets.jimDomain}";
|
2024-08-24 22:16:51 -04:00
|
|
|
certificateScheme = "acme-nginx";
|
|
|
|
localDnsResolver = false;
|
|
|
|
redis.port = 1515;
|
|
|
|
|
|
|
|
# A list of accounts, passwords generated with nix-shell -p mkpasswd --run 'mkpasswd -sm bcrypt'
|
|
|
|
loginAccounts = {
|
2024-08-30 01:17:50 -04:00
|
|
|
"noreply@${outputs.secrets.jimDomain}" = {
|
|
|
|
hashedPasswordFile = pkgs.writeText "noreply" outputs.secrets.noreplyMailHash;
|
2024-08-24 22:16:51 -04:00
|
|
|
sendOnly = true;
|
|
|
|
};
|
2024-08-30 01:17:50 -04:00
|
|
|
"jimbo@${outputs.secrets.jimDomain}" = {
|
|
|
|
hashedPasswordFile = pkgs.writeText "jimbo" outputs.secrets.jimboMailHash;
|
|
|
|
aliases = [ "canada@${outputs.secrets.jimDomain}" "contact@${outputs.secrets.jimDomain}" ];
|
2024-08-24 22:16:51 -04:00
|
|
|
};
|
2024-08-30 01:17:50 -04:00
|
|
|
"lunamoonlight@${outputs.secrets.jimDomain}" = {
|
|
|
|
hashedPasswordFile = pkgs.writeText "luna" outputs.secrets.lunaMailHash;
|
|
|
|
aliases = [ "us@${outputs.secrets.jimDomain}" "contact@${outputs.secrets.jimDomain}" ];
|
2024-08-24 22:16:51 -04:00
|
|
|
};
|
2024-08-30 01:17:50 -04:00
|
|
|
"freecorn1854@${outputs.secrets.jimDomain}" = {
|
|
|
|
hashedPasswordFile = pkgs.writeText "freecorn" outputs.secrets.freecornMailHash;
|
|
|
|
aliases = [ "canada@${outputs.secrets.jimDomain}" "contact@${outputs.secrets.jimDomain}" ];
|
2024-08-24 22:16:51 -04:00
|
|
|
};
|
2024-08-30 01:17:50 -04:00
|
|
|
"tinyattack09@${outputs.secrets.jimDomain}" = {
|
|
|
|
hashedPasswordFile = pkgs.writeText "tiny" outputs.secrets.tinyMailHash;
|
2024-08-24 22:16:51 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# Related services
|
|
|
|
services = {
|
|
|
|
# Roundcube mail server
|
|
|
|
roundcube = {
|
|
|
|
enable = true;
|
2024-08-30 01:17:50 -04:00
|
|
|
hostName = "mail.${outputs.secrets.jimDomain}";
|
2024-08-24 22:16:51 -04:00
|
|
|
extraConfig = ''
|
|
|
|
$config['smtp_server'] = "tls://${mailserver.fqdn}";
|
|
|
|
$config['smtp_user'] = "%u";
|
|
|
|
$config['smtp_pass'] = "%p";
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
# Force the mailserver to use a different redis port
|
|
|
|
redis.servers.rspamd.port = 1515;
|
2024-08-26 13:07:59 -04:00
|
|
|
|
|
|
|
# The hostname mail ports use
|
2024-08-30 01:17:50 -04:00
|
|
|
nginx.virtualHosts."mx.${outputs.secrets.jimDomain}" = {
|
2024-08-26 13:07:59 -04:00
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://127.0.0.1:1390";
|
|
|
|
proxyWebsockets = true;
|
|
|
|
};
|
|
|
|
};
|
2024-08-24 22:16:51 -04:00
|
|
|
};
|
|
|
|
}
|