This commit is contained in:
2025-09-12 21:57:38 +03:00
parent 8b5a67bdc1
commit 8186824c60

View File

@@ -82,7 +82,16 @@ in
}; };
}; };
services.postfix.config.virtual_mailbox_maps = [ "hash:/run/postfix/mastodon.cf" ]; # services.postfix.config = {
# smtp_sasl_auth_enable = "yes";
# smtp_sasl_security_options = "";
# smtp_sasl_password_maps = "texthash:/run/postfix/mastodon.cf";
# virtual_mailbox_maps = [ "hash:/run/postfix/mastodon.cf" ];
# };
mailserver.loginAccounts."noreply.mastodon@${sp.domain}" = {
hashedPasswordFile = "/run/postfix/mastodon.cf";
sendOnly = true;
};
systemd = { systemd = {
services.mastodon-email-password-setup = { services.mastodon-email-password-setup = {
@@ -102,7 +111,8 @@ in
rm -f /run/postfix/mastodon.cf || true rm -f /run/postfix/mastodon.cf || true
mkdir /run/postfix/ || true # Create /run/postfix if it doesn't exist mkdir /run/postfix/ || true # Create /run/postfix if it doesn't exist
export hashedPassword=$(${lib.getExe pkgs.mkpasswd} -sm bcrypt "$password") export hashedPassword=$(${lib.getExe pkgs.mkpasswd} -sm bcrypt "$password")
echo "noreply.mastodon@${sp.domain}: $hashedPassword" > /run/postfix/mastodon.cf # echo "noreply.mastodon@${sp.domain}: $hashedPassword" > /run/postfix/mastodon.cf
echo "$hashedPassword" > /run/postfix/mastodon.cf
chmod 440 /run/postfix/mastodon.cf chmod 440 /run/postfix/mastodon.cf
chown ${config.services.postfix.user}:${config.services.postfix.group} /run/postfix/mastodon.cf chown ${config.services.postfix.user}:${config.services.postfix.group} /run/postfix/mastodon.cf
''; '';