diff --git a/module.nix b/module.nix index 9fa77c9..7c0d025 100644 --- a/module.nix +++ b/module.nix @@ -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 = { services.mastodon-email-password-setup = { @@ -102,7 +111,8 @@ in rm -f /run/postfix/mastodon.cf || true mkdir /run/postfix/ || true # Create /run/postfix if it doesn't exist 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 chown ${config.services.postfix.user}:${config.services.postfix.group} /run/postfix/mastodon.cf '';