Re: [PATCH v5 3/3] send-email: add option to generate passswords like OAuth2 tokens

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux