2025-01-19 15:31:02 -05:00
|
|
|
{ mailserver, config, lib, pkgs, ... }:
|
2024-10-22 20:43:32 -04:00
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
./nginx
|
|
|
|
mailserver.nixosModule
|
|
|
|
];
|
|
|
|
|
|
|
|
mailserver = rec {
|
2024-12-22 22:02:10 -05:00
|
|
|
enable = config.system.mailserver.enable;
|
2024-10-24 23:04:34 -04:00
|
|
|
domains = [
|
2025-01-01 02:02:00 -05:00
|
|
|
"${config.domains.p1}"
|
|
|
|
"${config.domains.p2}"
|
2024-10-24 23:42:09 -04:00
|
|
|
"${config.domains.luna}"
|
|
|
|
"${config.domains.corn}"
|
2024-10-24 23:04:34 -04:00
|
|
|
];
|
2025-01-01 02:02:00 -05:00
|
|
|
fqdn = "mx.${config.domains.p1}";
|
2024-10-22 20:43:32 -04:00
|
|
|
certificateScheme = "acme-nginx";
|
|
|
|
localDnsResolver = false;
|
|
|
|
redis.port = 1515;
|
|
|
|
|
2024-12-22 22:02:10 -05:00
|
|
|
# Passwords made with 'mkpasswd -sm bcrypt'
|
2024-10-22 20:43:32 -04:00
|
|
|
loginAccounts = {
|
2025-01-02 10:13:00 -05:00
|
|
|
"noreply@${config.domains.p2}" = {
|
2024-10-22 20:43:32 -04:00
|
|
|
hashedPasswordFile = pkgs.writeText "noreply" config.secrets.noreplyMailHash;
|
|
|
|
sendOnly = true;
|
|
|
|
};
|
2025-01-01 02:02:00 -05:00
|
|
|
"jimbo@${config.domains.p2}" = {
|
2024-10-22 20:43:32 -04:00
|
|
|
hashedPasswordFile = pkgs.writeText "jimbo" config.secrets.jimboMailHash;
|
2024-10-24 23:04:34 -04:00
|
|
|
aliases = [
|
2025-01-01 02:02:00 -05:00
|
|
|
"jimbo@${config.domains.p1}"
|
|
|
|
"james@${config.domains.p2}"
|
2025-01-01 22:42:08 -05:00
|
|
|
|
2025-01-02 10:13:00 -05:00
|
|
|
"vicee@${config.domains.p2}"
|
2025-01-01 02:02:00 -05:00
|
|
|
"vice@${config.domains.p2}"
|
|
|
|
"yara@${config.domains.p2}"
|
|
|
|
"yaralis@${config.domains.p2}"
|
2025-01-01 22:42:08 -05:00
|
|
|
|
2025-01-01 02:02:00 -05:00
|
|
|
"contact@${config.domains.p2}"
|
2024-10-24 23:04:34 -04:00
|
|
|
];
|
2024-10-22 20:43:32 -04:00
|
|
|
};
|
2024-10-24 23:42:09 -04:00
|
|
|
"luna@${config.domains.luna}" = {
|
2024-10-22 20:43:32 -04:00
|
|
|
hashedPasswordFile = pkgs.writeText "luna" config.secrets.lunaMailHash;
|
|
|
|
};
|
2024-10-24 23:42:09 -04:00
|
|
|
"corn@${config.domains.corn}" = {
|
2024-10-22 22:45:42 -04:00
|
|
|
hashedPasswordFile = pkgs.writeText "corn" config.secrets.cornMailHash;
|
2024-10-22 20:43:32 -04:00
|
|
|
};
|
2024-10-24 23:42:09 -04:00
|
|
|
"tiny@${config.domains.corn}" = {
|
2024-10-22 20:43:32 -04:00
|
|
|
hashedPasswordFile = pkgs.writeText "tiny" config.secrets.tinyMailHash;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-11-13 03:43:51 -05:00
|
|
|
# Rspamd port from earlier to avoid overlap
|
2024-10-22 20:43:32 -04:00
|
|
|
services.redis.servers.rspamd.port = 1515;
|
2025-01-20 15:45:25 -05:00
|
|
|
services.ddclient.domains = lib.mkIf config.mailserver.enable [
|
|
|
|
"mx.${config.domains.p1}"
|
|
|
|
"mx.${config.domains.p2}"
|
|
|
|
"mail.${config.domains.p2}"
|
|
|
|
];
|
2024-10-22 20:43:32 -04:00
|
|
|
}
|