Access Keys:
Skip to content (Access Key - 0)

Q: How can I configure Pine or Alpine to use MIT's M365 email?

Microsoft 365 (Exchange in the cloud) requires two-factor authentication (also known as Modern Auth) which Pine/Alpine can accomplish via XOAUTH2. Verify your mailbox is on M365 before making these changes to your Alpine configuration by either contacting the service desk or attempt to log into outlook.office.com.

Configuration

These settings apply to Alpine on the athena dialups, but should also work with Alpine on a personal workstation. You can either edit ~/.pinerc directly with a text editor, or start Alpine and go to Setup >> Config. Assuming a Kerberos username of "tim", set the following values:

inbox-path={outlook.office365.com:993/ssl/user=tim@mit.edu/auth=xoauth2}INBOX
folder-collections="MIT Mail" {outlook.office365.com:993/ssl/user=tim@mit.edu/auth=xoauth2}[]

If you are using Alpine on a personal workstation with sendmail/postfix as MTA, set:

customized-hdrs=From: "Tim Beaver" <tim@mit.edu>

In all cases, you need to create a file where Alpine can store the oauth credentials:

touch ~/.pine-passfile

Upon starting Alpine with these settings, you will be presented with a window:

If you are ssh'd into athena.dialup.mit.edu, you do not need X11 forwarding for this to work. Visit https://microsoft.com/devicelogin from any browser, whether it is on athena or not, and log into your account via Touchstone, providing the code Alpine gave you on your screen. Once complete, Alpine will ask for a master password to encrypt .pine-passfile. After setting a password for the passfile, you should have access to your inbox.

Troubleshooting

If you receive this error:

Code 400: Invalid grant: AADSTS700082: The refresh token has expired due to inactivity.

Your token has expired and you will need to obtain a new one. Destroy the contents of .pine-passfile and retain the file itself:

tim@musical-notes:~$ > ~/.pine-passfile

then run alpine again and you will be presented with the same window as shown in the initial setup. Visit https://microsoft.com/devicelogin from any browser, whether it is on athena or not, and log into your account via Touchstone, providing the code Alpine gave you on your screen. Once complete, Alpine will ask for a master password to encrypt .pine-passfile. After setting a password for the passfile, you should have access to your inbox.

IS&T Contributions

Documentation and information provided by IS&T staff members


Last Modified:

February 23, 2024

Get Help

Request help
from the Help Desk
Report a security incident
to the Security Team
Labels:
c-pine c-pine Delete
c-o365 c-o365 Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
Feedback
This product/service is:
Easy to use
Average
Difficult to use

This article is:
Helpful
Inaccurate
Obsolete
Adaptavist Theme Builder (4.2.3) Powered by Atlassian Confluence 3.5.13, the Enterprise Wiki