On Thu Apr 24, 2025 at 9:53 AM CEST, Aditya Garg wrote: > Some email providers like outlook allow only OAuth2 tokens to be used > for authentication. This commit adds an option to generate OAuth2 tokens > using scripts like M365-IMAP[1]. This option is similar to passwordeval > in msmtp. > > Example usage: > > [sendemail] > smtpEncryption = tls > smtpServer = smtp.office365.com > smtpUser = someone@xxxxxxxxxxx > smtpServerPort = 587 > smtpauth = XOAUTH2 > smtpPassEval = cd /workspaces/codespaces-blank/M365-IMAP && python3 ./refresh_token.py > Having the option `smtpPassEval` is a little more intuitive, but can't this also be achieved using a custom credential helper[0]? Something like: [credential "smtp://smtp.office365.com:587"] username = someone@xxxxxxxxxxx helper = "!f() { test \"$1\" = get && echo \"password=$(cd /workspaces/codespaces-blank/M365-IMAP && python3 ./refresh_token.py)\"; }; f" Regards Julian [0] https://git-scm.com/docs/gitcredentials.html#_custom_helpers