Cleanup mail domains
This commit is contained in:
parent
5ed02e924d
commit
a795c65c32
@ -1,8 +1,20 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
with builtins;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.mailserver;
|
cfg = config.mailserver;
|
||||||
|
domains = [
|
||||||
|
"neet.space"
|
||||||
|
"neet.dev"
|
||||||
|
"neet.cloud"
|
||||||
|
"runyan.org"
|
||||||
|
"runyan.rocks"
|
||||||
|
"thunderhex.com"
|
||||||
|
"tar.ninja"
|
||||||
|
"bsd.ninja"
|
||||||
|
"bsd.rocks"
|
||||||
|
];
|
||||||
in {
|
in {
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
mailserver = {
|
mailserver = {
|
||||||
@ -13,21 +25,11 @@ in {
|
|||||||
fullTextSearch.enable = true;
|
fullTextSearch.enable = true;
|
||||||
fullTextSearch.indexAttachments = true;
|
fullTextSearch.indexAttachments = true;
|
||||||
fullTextSearch.memoryLimit = 500;
|
fullTextSearch.memoryLimit = 500;
|
||||||
domains = [
|
inherit domains;
|
||||||
"neet.space" "neet.dev" "neet.cloud"
|
|
||||||
"runyan.org" "runyan.rocks"
|
|
||||||
"thunderhex.com" "tar.ninja"
|
|
||||||
"bsd.ninja" "bsd.rocks"
|
|
||||||
];
|
|
||||||
loginAccounts = {
|
loginAccounts = {
|
||||||
"jeremy@runyan.org" = {
|
"jeremy@runyan.org" = {
|
||||||
hashedPasswordFile = "/run/agenix/email-pw";
|
hashedPasswordFile = "/run/agenix/email-pw";
|
||||||
aliases = [
|
aliases = map (domain: "@${domain}") domains;
|
||||||
"@neet.space" "@neet.cloud" "@neet.dev"
|
|
||||||
"@runyan.org" "@runyan.rocks"
|
|
||||||
"@thunderhex.com" "@tar.ninja"
|
|
||||||
"@bsd.ninja" "@bsd.rocks"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
rejectRecipients = [
|
rejectRecipients = [
|
||||||
@ -55,17 +57,8 @@ in {
|
|||||||
};
|
};
|
||||||
services.postfix.mapFiles.sender_relay = let
|
services.postfix.mapFiles.sender_relay = let
|
||||||
relayHost = "[smtp.mailgun.org]:587";
|
relayHost = "[smtp.mailgun.org]:587";
|
||||||
in pkgs.writeText "sender_relay" ''
|
in pkgs.writeText "sender_relay"
|
||||||
@neet.space ${relayHost}
|
(concatStringsSep "\n" (map (domain: "@${domain} ${relayHost}") domains));
|
||||||
@neet.cloud ${relayHost}
|
|
||||||
@neet.dev ${relayHost}
|
|
||||||
@runyan.org ${relayHost}
|
|
||||||
@runyan.rocks ${relayHost}
|
|
||||||
@thunderhex.com ${relayHost}
|
|
||||||
@tar.ninja ${relayHost}
|
|
||||||
@bsd.ninja ${relayHost}
|
|
||||||
@bsd.rocks ${relayHost}
|
|
||||||
'';
|
|
||||||
services.postfix.mapFiles.sasl_relay_passwd = "/run/agenix/sasl_relay_passwd";
|
services.postfix.mapFiles.sasl_relay_passwd = "/run/agenix/sasl_relay_passwd";
|
||||||
age.secrets.sasl_relay_passwd.file = ../../secrets/sasl_relay_passwd.age;
|
age.secrets.sasl_relay_passwd.file = ../../secrets/sasl_relay_passwd.age;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user