Set OAuth2 authentication declaratively for Thunderbird with home-manager

Hello everyone,

I’m trying to set up my school email which is managed by Microsoft through home-manager’s accounts.email.accounts. How can I set the authentication method there? Microsoft requires OAuth2, I think.

Hi,

You can setup this with additional settings in your home manager config file:

accounts.email.accounts = {
  personal = {
    thunderbird = {
      settings =
        id: {
          "mail.server.server_${id}.authMethod" = 10;
          "mail.smtpserver.smtp_${id}.authMethod" = 10;
        };
    };
  };
};

Value 10 means OAuth option and above lines set OAuth method for both in/out servers.