Cannot setup email password declaratively

Hi, I am trying to set up thunderbird declaratively. Here’s my config:

{ pkgs, config, current, ... }:

{
  programs.thunderbird = {
    enable = true;
    profiles.${current.user} = {
      isDefault = true;
    };
  };

  accounts.email = {
    accounts.outlook = {
      realName = "name";
      address = "email id";
      userName = "email id";
      primary = true;
      imap = {
        host = "outlook.office365.com";
        port = 993;
      };
      passwordCommand = "cat ${config.age.secrets.microsoft.path}";
      thunderbird = {
        enable = true;
        profiles = [ "${current.user}" ];
      };
    };
  };
}

but for some reason, thunderbird keeps asking me for password. I have checked /run/agenix.d/1/microsoft and it contains the password. I’m not sure what I’m doing wrong here.

passwordCommand is for the various fetcher services, Thunderbird has no way of using it. I somewhat doubt it supports any of the email account settings, actually. I think Thunderbird supports the secret service, though, so you can hook something like the gnome keyring or keepass to it.

Thunderbird filled in everything I mentioned except the password. Hence I thought it’d work.

Oh, really cool, seems the module converts those to a Thunderbird profile: https://github.com/nix-community/home-manager/blob/a4a72ffd76f2c974601e7adff356e5c277e08077/modules/programs/thunderbird.nix#L66

But the module does not use passwordCommand. I’d assume this is because Thunderbird has no way to execute a shell command for authentication, which isn’t really expected from a glossy GUI client.

Thanks for checking. I should have checked it before asking the question tbf, but I forgot.