fetchmail + oauth2 + outlook

"Gerard E. Seibert" <[email protected]> Sun, 12 Jan 2025 11:56:59 -0500
Newsgroups gmane.mail.fetchmail.user
Message-ID <[email protected]>
This is from a FreeBSD 14.2-RELEASE OS

I have been trying for the first time to get fetchmail to work with outlook.com and oauth2. It has been a colossal failure.

I tried Googling for an answer and discovered a virtual cornucopia of different and sometimes conflicting scenarios.

The last one I tried was this one.

This is from a FreeBSD 14.2-RELEASE OS

I have been trying for the first time to get fetchmail to work with outlook.com and oauth2. It has been a colossal failure.

I tried Googling for an answer and discovered a virtual cornucopia of different and sometimes conflicting scenarios.

The last one I tried was this one.

poll outlook.office365.com with protocol imap timeout 30 and options bad-header accept
    auth oauthbearer <User Email Address>
    passwordfile "/home/john/.fetchmail-token" is <John_Smith> here
    options flush forcecr dropdelivered smtpname 'john_smith@mydomain,com' ssl sslproto 'auto' sslcertfile /usr/local/share/certs/ca-root-nss.crt sslcertck sslcertpath /usr/local/etc/

This is fetchmails response.

fetchmail:/usr/local/etc/fetchmailrc:46: syntax error, unexpected STRING, expecting AUTHTYPE at oauthbearer
fetchmail:/usr/local/etc/fetchmailrc:46: syntax error, unexpected STRING, expecting AUTHTYPE at oauthbearer
Stopping fetchmail.
Waiting for PIDS: 52729.
Starting fetchmail.
fetchmail:/usr/local/etc/fetchmailrc:46: syntax error, unexpected STRING, expecting AUTHTYPE at oauthbearer
/usr/local/etc/rc.d/fetchmail: WARNING: failed to start fetchmail

I found nothing in the Fetchmail FAQ or manual for configuring oauth2 with outlook.

Fetchmail's version:

This is fetchmail release 6.5.1+RPA+SDPS+TLS+NLS.
Compiled with SSL library 0x30300020 "OpenSSL 3.3.2 3 Sep 2024"
Run-time uses SSL library 0x30300020 "OpenSSL 3.3.2 3 Sep 2024"
OpenSSL: OPENSSLDIR: "/usr/local/openssl"
Engines: ENGINESDIR: "/usr/local/lib/engines-15"

I am hoping someone could assist me.
-- 

Thanks!

Gerard