Author Topic: Stuck with office365 setup  (Read 2552 times)

Offline llaurent59

  • Newbie
  • *
  • Posts: 3
Stuck with office365 setup
« on: October 24, 2022, 06:23:51 PM »
Hello :)

I have Roundcube 1.6 installed on a Windows Server 2019 since 2 years - and it worked perfectly until last friday
-> at 07:35, here is the log details
[21-Oct-2022 07:35:00 +0000]: [63ED] Connecting to ssl://outlook.office365.com:993...
[21-Oct-2022 07:35:00 +0000]: [63ED] S: * OK The Microsoft Exchange IMAP4 service is ready. [TABPADQAUAAyADYANQBDAEEAMAAwADMAMQAuAEcAQgBSAFAAMgA2ADUALgBQAFIATwBEAC4ATwBVAFQATABPAE8ASwAuAEMATwBNAA==]
[21-Oct-2022 07:35:00 +0000]: [63ED] C: A0001 CAPABILITY
[21-Oct-2022 07:35:00 +0000]: [63ED] S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
[21-Oct-2022 07:35:00 +0000]: [63ED] S: A0001 OK CAPABILITY completed.
[21-Oct-2022 07:35:00 +0000]: [63ED] C: A0002 AUTHENTICATE PLAIN ****** [49]
[21-Oct-2022 07:35:01 +0000]: [63ED] S: A0002 OK AUTHENTICATE completed.
[21-Oct-2022 07:35:01 +0000]: [63ED] C: A0003 ID ("name" "Roundcube" "version" "1.5-rc" "php" "7.2.18" "os" "WINNT" "command" NIL)
[21-Oct-2022 07:35:01 +0000]: [63ED] S: * ID ("name" "Microsoft.Exchange.Imap4.Imap4Server" "version" "15.20")
[21-Oct-2022 07:35:01 +0000]: [63ED] S: A0003 OK ID completed
[21-Oct-2022 07:35:01 +0000]: [63ED] C: A0004 NAMESPACE
[21-Oct-2022 07:35:01 +0000]: [63ED] S: * NAMESPACE (("" "/")) NIL NIL
[21-Oct-2022 07:35:01 +0000]: [63ED] S: A0004 OK NAMESPACE completed.
[21-Oct-2022 07:35:01 +0000]: [63ED] C: A0005 SELECT INBOX

but 30 minutes later :
[21-Oct-2022 08:05:00 +0000]: [B53D] Connecting to ssl://outlook.office365.com:993...
[21-Oct-2022 08:05:00 +0000]: [B53D] S: * OK The Microsoft Exchange IMAP4 service is ready. [TABPADIAUAAyADYANQBDAEEAMAAyADAANQAuAEcAQgBSAFAAMgA2ADUALgBQAFIATwBEAC4ATwBVAFQATABPAE8ASwAuAEMATwBNAA==]
[21-Oct-2022 08:05:00 +0000]: [B53D] C: A0001 CAPABILITY
[21-Oct-2022 08:05:00 +0000]: [B53D] S: * CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
[21-Oct-2022 08:05:00 +0000]: [B53D] S: A0001 OK CAPABILITY completed.
[21-Oct-2022 08:05:00 +0000]: [B53D] C: A0002 AUTHENTICATE PLAIN ****** [49]
[21-Oct-2022 08:05:01 +0000]: [B53D] S: A0002 NO AUTHENTICATE failed.


Any help for setting my office365 configuration ???

Thanks in advance

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: Stuck with office365 setup
« Reply #1 on: October 25, 2022, 05:57:59 PM »

Offline llaurent59

  • Newbie
  • *
  • Posts: 3
Re: Stuck with office365 setup
« Reply #2 on: October 30, 2022, 06:56:42 PM »
Hello :)

could you give me help about this
how can I implement oauth2

Thanks in advance

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: Stuck with office365 setup
« Reply #3 on: October 30, 2022, 10:08:05 PM »
Look at the oauth section in the <RC root>/config/defaults.inc.php file, at the bottom there is an example for Office365.

Offline llaurent

  • Newbie
  • *
  • Posts: 1
Re: Stuck with office365 setup
« Reply #4 on: May 26, 2023, 02:48:56 AM »
Hello :)

I'm still stuck with oauth2 configuration
any help or tutorial highly appreciated

Thanks in advance

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,876
    • SKaero - Custom Roundcube development
Re: Stuck with office365 setup
« Reply #5 on: May 26, 2023, 05:13:49 PM »
Code: [Select]
///// Example config for Outlook.com (Office 365)

// Register your OAuth client at https://portal.azure.com
// - use https://<your-roundcube-url>/index.php/login/oauth as redirect URL
// - grant permissions to Microsoft Graph API "IMAP.AccessAsUser.All", "SMTP.Send", "User.Read" and "offline_access"

// $config['imap_host'] = 'ssl://outlook.office365.com';
// $config['smtp_host'] = 'ssl://smtp.office365.com';

// $config['oauth_provider'] = 'outlook';
// $config['oauth_provider_name'] = 'Outlook.com';
// $config['oauth_client_id'] = "<your-credentials-client-id>";
// $config['oauth_client_secret'] = "<your-credentials-client-secret>";
// $config['oauth_auth_uri'] = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize";
// $config['oauth_token_uri'] = "https://login.microsoftonline.com/common/oauth2/v2.0/token";
// $config['oauth_identity_uri'] = "https://graph.microsoft.com/v1.0/me";
// $config['oauth_identity_fields'] = ['email', 'userPrincipalName'];
// $config['oauth_scope'] = "https://outlook.office365.com/IMAP.AccessAsUser.All https://outlook.office365.com/SMTP.Send User.Read offline_access";
// $config['oauth_auth_parameters'] = ['nonce' => mt_rand()];