nix-community / home-manager

Manage a user environment using Nix [maintainer=@rycee]
https://nix-community.github.io/home-manager/
MIT License
6.69k stars 1.76k forks source link

Add `authenticationMethod` setting to `accounts.email.accounts` #5137

Open charludo opened 6 months ago

charludo commented 6 months ago

Description

While most mail providers accept simple password authentication, some (like gmail) do not, accepting only oauth2. I'm aware that you can set an account's flavor to e.g. gmail.com, however, this does not set an auth method.

Usecase

When using e.g. Thunderbird as a mail client and declaring the email account setup via hm, Thunderbird keeps prompting for the password for accounts requiring oauth2. Simply going into account settings and setting the auth method to the correct one immediately fixes the issue (instead of prompting for a password, Thunderbird starts the oauth-flow).

This results in only minor changes to the hm-generated user.js settings, so I imagine this should be relatively straightforward to add as a setting.

cterence commented 5 months ago

Hi, have you seen #4988 ? There is a way to configure the auth method to OAuth by adding two settings directly. It's not ideal but not that bad of a workaround.

DerRockWolf commented 3 months ago

Gmail still supports password authentication using app passwords. They can be created at https://myaccount.google.com/apppasswords

corentin-dev commented 3 weeks ago

Also interested. In my case, I need NTLM authentication. Don't know if this is doable or not.