Send mail through mailgun

This commit is contained in:
Zuckerberg 2022-05-03 18:33:48 -04:00
parent 91e38f5866
commit dfec18e904
3 changed files with 26 additions and 1 deletions

View File

@ -38,7 +38,6 @@
"runyan.org" "runyan.rocks"
"thunderhex.com" "tar.ninja"
"bsd.ninja" "bsd.rocks"
"paradigminteractive.agency"
];
loginAccounts = {
"jeremy@runyan.org" = {
@ -61,6 +60,31 @@
};
age.secrets.email-pw.file = ../../secrets/email-pw.age;
# relay sent mail through mailgun
# https://www.howtoforge.com/community/threads/different-smtp-relays-for-different-domains-in-postfix.82711/#post-392620
services.postfix.config = {
smtp_sasl_auth_enable = "yes";
smtp_sasl_security_options = "noanonymous";
smtp_sasl_password_maps = "hash:/var/lib/postfix/conf/sasl_relay_passwd";
smtp_use_tls = "yes";
sender_dependent_relayhost_maps = "hash:/var/lib/postfix/conf/sender_relay";
};
services.postfix.mapFiles.sender_relay = let
relayHost = "[smtp.mailgun.org]:587";
in pkgs.writeText "sender_relay" ''
@neet.space ${relayHost}
@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";
age.secrets.sasl_relay_passwd.file = ../../secrets/sasl_relay_passwd.age;
services.nextcloud = {
enable = true;
https = true;

Binary file not shown.

View File

@ -18,4 +18,5 @@ in
"wolframalpha.age".publicKeys = all;
"cloudflared-navidrome.json.age".publicKeys = all;
"smb-secrets.age".publicKeys = all;
"sasl_relay_passwd.age".publicKeys = all;
}