From b36622bb43d64672dfedff596c11a0280e6b4816 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Sun, 29 Jun 2025 23:58:11 +0800 Subject: mail: remove mail server, run roundcube for outlook. --- services/templates/roundcube.inc.php.template | 56 +++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 services/templates/roundcube.inc.php.template (limited to 'services/templates/roundcube.inc.php.template') diff --git a/services/templates/roundcube.inc.php.template b/services/templates/roundcube.inc.php.template new file mode 100644 index 0000000..70b0aff --- /dev/null +++ b/services/templates/roundcube.inc.php.template @@ -0,0 +1,56 @@ + 'smtp.example.net'] +$config['smtp_host'] = 'tls://smtp-mail.outlook.com:587'; + +// Register your OAuth client at https://portal.azure.com +// - use https:///index.php/login/oauth as redirect URL +// - grant permissions to Microsoft Graph API "IMAP.AccessAsUser.All", "SMTP.Send", "User.Read" and "offline_access" + +$config['oauth_provider'] = 'outlook'; +$config['oauth_provider_name'] = 'Outlook.com'; +$config['oauth_client_id'] = "@@CRUPEST_ROUNDCUBE_OAUTH_CLIENT_ID@@"; +$config['oauth_client_secret'] = "@@CRUPEST_ROUNDCUBE_OAUTH_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()]; + +// Logon username filter. Regular expression for use with preg_match(). +// Use special value 'email' if you accept only full email addresses as user logins. +// Example: '/^[a-z0-9_@.-]+$/' +$config['login_username_filter'] = '@@CRUPEST_EMAIL@@'; -- cgit v1.2.3