skip to content
 

Configuring for Exchange Online

In your home directory run the command below. The brackets are part of the command.

( umask 077 ; touch ~/.pine-passfile )

Open Pine.

  • Go into settings ('M', 'S','C')
  • Ensure User Domain is set to: cam.ac.uk
  • Set SMTP Server to: smtp.office365.com:587/tls/user=${USER}@cam.ac.uk/submit/auth=xoauth2
  • Set Inbox Path to: outlook.office365.com/ssl/user=${USER}@cam.ac.uk/auth=xoauth2

Save and exit settings

When you next do something that requires authentication, such as looking at your inbox, pine will start the OAuth2 authentication process. It will offer a choice of Outlook (Device) and Outlook (Authorize).

  • Choose Outlook (Device)

This will give you a URL to go to in a web browser; and a code to enter.

This may then redirect you to the standard sign in page for the new email service. Your sign in with your crsid@cam.ac.uk address.

If you have MFA enabled you may also be asked to authorize the login through the app on your mobile.  Do this.

Shortly afterwards pine will detect you have authenticated. Pine will now save the token so you do not keep having to do the above. Pine will ask you to a set a master password to protect your password.

Go back to your mail and you should now see your inbox.

 

Access to folders

To add a "folder Collection":

  • ('M', 'S' ,'L' ,'A')
  • Then beside Server put the following: {outlook.office365.com/ssl/user=${USER}@cam.ac.uk/auth=xoauth2}
  • Save and done.

 

 

Troubleshooting

Forgotten master password:

If you ever forget the password you can delete your .pine-passfile file and go through the OAuth2 authentication process part again e.g.:

( umask 077 ; rm ~/.pine-passfile ; touch ~/.pine-passfile )

Invalid grant error

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 e.g.:

( umask 077 ; rm ~/.pine-passfile ; touch ~/.pine-passfile )

Then run pine 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 in Maths or not, and log into your University account, providing the code pine gave you on your screen. Once complete, pine will ask for a master password to encrypt .pine-passfile. After setting a password for the passfile, you should have access to your inbox.