• Re: Alpine and O365 Gateway

    From Brandon Jewett-Hall@brandonh@google.com to comp.mail.pine on Mon Oct 2 09:11:39 2023
    From Newsgroup: comp.mail.pine

    Hi Pascal,
    I was able to get DavMail + Alpine working for a similar situation (university Office365 account that disallows most email applications). In my case, the IT department allows use of Mac Mail (Mail.app), so I set up my account with Mail.app on my Mac, and then I was able to spoof Mac Mail by copying the Exchange refresh token out of the Keychain and setting .davmail.properties like so (replace the email string in the refresh token property name accordingly):
    davmail.mode=O365Manual davmail.oauth.clientId=f8d98a96-0999-43f5-8af3-69971c7bb423 davmail.oauth.redirectUri=com.apple.Preferences://oauth-redirect/ davmail.oauth.youremail@example.edu.refreshToken=<REFRESH TOKEN>
    On the Alpine side, I use plain auth for IMAP+SMTP and enter a fake password when prompted (any non-empty value will do), which appears to be needed to trigger the correct OAuth flow inside DavMail. After successful auth, in my case, DavMail rewrote the refresh token property in my properties file with an AES-encrypted version (presumably for the questionable rationale of avoiding plaintext).
    The obvious downside of this approach is that you have to manually update the refresh token from Keychain whenever O365 forces re-auth, but these events are typically infrequent (on the order of months or years).
    On Friday, November 26, 2021 at 12:57:38rC>AM UTC-8, Pascal W wrote:
    Thanks! From reading the documentation of DavMail my understanding is that Alpine will still be required to be approved by Azure AD administrators. At my company they have flipped the switch from default setting and do not allow developer self-service consent for apps. DavMail will not solve that problem for me.

    /Pascal
    On Thursday, November 18, 2021 at 3:31:31 AM UTC+1, Eduardo Chappa wrote:
    On Wed, 17 Nov 2021, Pascal W wrote:

    Hi! Does anyone have experience proxying Alpine via this "O365 gateway"?

    https://github.com/mguessan/davmail
    Yes, Davmail is a tool that allows you access an exchange server (using the exchange protocol) through an imap gateway. My experience is that it is slow, but if that is what you will be allowed to use it is better than nothing. The default concept of "deleted" in davmail is "deleted and expunged" so configure it to not to expunge upon deletion.

    Good luck!

    --
    Eduardo
    https://tinyurl.com/yc377wlh (web)
    http://repo.or.cz/alpine.git (Git)
    --- Synchronet 3.21d-Linux NewsLink 1.2