Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e4429bec authored by Akhil's avatar Akhil 🙂
Browse files

Merge branch 'nc-25' into 'main'

NC 25

See merge request !157
parents dff21c3b b32ed38f
Loading
Loading
Loading
Loading
Loading
+37 −27
Original line number Diff line number Diff line
FROM nextcloud:24.0.10-fpm AS nextcloud
FROM nextcloud:25.0.6-fpm AS nextcloud
ARG BASE_DIR="/usr/src/nextcloud"
ARG TMP_PATCH_DIR="/tmp/build_patches"
ARG THEME_HELPER_JOB_ID="515506"
ARG NOTES_VERSION="4.5.1"
ARG CONTACTS_JOB_ID="525457"
ARG CALENDAR_JOB_ID="525449"
ARG EMAIL_RECOVERY_JOB_ID="525467"
ARG EA_JOB_ID="526684"
ARG ECLOUD_LAUNCHER_JOB_ID="522867"
ARG THEME_HELPER_JOB_ID="582464"
ARG NOTES_VERSION="4.7.2"
ARG CONTACTS_JOB_ID="582012"
ARG CALENDAR_JOB_ID="582001"
ARG EMAIL_RECOVERY_JOB_ID="582038"
ARG EA_JOB_ID="582028"
ARG LAUNCHER_JOB_ID="582666"
ARG GOOGLE_INTEGRATION_VERSION="1.0.9"
ARG ECLOUD_DASHBOARD_JOB_ID="525503"
ARG SNAPPY_VERSION="2.26.3"
ARG SNAPPY_THEME_VERSION="1.2.3"
ARG DASHBOARD_JOB_ID="582062"
ARG SNAPPY_VERSION="2.27.2"
ARG SNAPPY_THEME_VERSION="1.2.7"

RUN sed -i 's/24,0,10,1/24,0,10,10/' ${BASE_DIR}/version.php
RUN sed -i 's/25,0,6,1/25,0,6,4/' ${BASE_DIR}/version.php
COPY custom_entrypoint.sh /
RUN chmod +x /custom_entrypoint.sh
RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images
@@ -52,7 +52,7 @@ RUN curl -fsSL -o ecloud-theme-helper.zip \
    rm ecloud-theme-helper.zip;

RUN curl -fsSL -o murena_launcher.zip \
    "https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/launcher/-/jobs/${ECLOUD_LAUNCHER_JOB_ID}/artifacts/download" && \
    "https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/launcher/-/jobs/${LAUNCHER_JOB_ID}/artifacts/download" && \
    unzip murena_launcher.zip && \
    mv dist/murena_launcher ${BASE_DIR}/custom_apps/ && \
    rm murena_launcher.zip;
@@ -70,9 +70,9 @@ RUN curl -fsSL -o ecloud-accounts.zip \
    rm ecloud-accounts.zip;

RUN curl -fsSL -o ecloud-dashboard.zip \
    "https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/ecloud-dashboard/-/jobs/${ECLOUD_DASHBOARD_JOB_ID}/artifacts/download" && \
    "https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/murena-dashboard/-/jobs/${DASHBOARD_JOB_ID}/artifacts/download" && \
    unzip ecloud-dashboard.zip && \
    mv dist/ecloud-dashboard ${BASE_DIR}/custom_apps/ && \
    mv dist/murena-dashboard ${BASE_DIR}/custom_apps/ && \
    rm ecloud-dashboard.zip;

RUN curl -fsSL -o snappymail.tar.gz \
@@ -80,11 +80,15 @@ RUN curl -fsSL -o snappymail.tar.gz \
    tar -xf snappymail.tar.gz -C ${BASE_DIR}/custom_apps/ && \
    rm snappymail.tar.gz;

# Fix snappymail icon
RUN sed -i 's/logo-white-64x64.png/app.svg/' ${BASE_DIR}/custom_apps/snappymail/appinfo/info.xml

# Snappy theme
RUN curl -fsSL -o Murena-snappymail-theme.tar.gz \
    "https://gitlab.e.foundation/e/infra/ecloud/nextcloud-apps/snappymail-theme/-/archive/${SNAPPY_THEME_VERSION}/snappymail-theme-${SNAPPY_THEME_VERSION}.tar.gz" && \
    tar -xf Murena-snappymail-theme.tar.gz -C /tmp/ && \
    mv /tmp/snappymail-theme-${SNAPPY_THEME_VERSION}/ ${BASE_DIR}/themes/Murena && \
    mkdir -p ${BASE_DIR}/themes/Murena/snappymail && \
    mv /tmp/snappymail-theme-${SNAPPY_THEME_VERSION}/ ${BASE_DIR}/themes/Murena/snappymail && \
    chown -R www-data:www-data ${BASE_DIR}/themes/Murena/ && \
    rm -rf Murena-snappymail-theme.tar.gz

@@ -94,6 +98,9 @@ RUN apt-get -y remove unzip
# force eCloud theme not to be disabled even when there is an upgrade process launched
RUN sed -i "s/\$systemConfig->setValue('theme', '');/\$systemConfig->setValue('theme', 'eCloud');/g" ${BASE_DIR}/lib/base.php

# Disable editor feature of media viewer
RUN sed -i 's/!this.isMobile/!this.isMobile\&\&false/' ${BASE_DIR}/apps/viewer/js/viewer-main.js

ENTRYPOINT ["/custom_entrypoint.sh"]
CMD ["php-fpm"]

@@ -108,8 +115,6 @@ COPY patches/ ${TMP_PATCH_DIR}/
RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/002-login-without-domain.patch
RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/006-recovery-email-changes.patch
RUN patch -u ${BASE_DIR}/apps/settings/lib/Settings/Personal/ServerDevNotice.php -i ${TMP_PATCH_DIR}/007-remove-dev-notice.patch
RUN patch -u ${BASE_DIR}/lib/private/Template/IconsCacher.php -i ${TMP_PATCH_DIR}/008-icons-cacher-theme-svgs.patch
RUN patch -u ${BASE_DIR}/core/Controller/SvgController.php -i ${TMP_PATCH_DIR}/008-svg-controller-theme-svgs.patch
RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/009-help-links.patch
RUN patch -u ${BASE_DIR}/lib/private/Updater.php -i ${TMP_PATCH_DIR}/010-disable-app-store-upgrade.patch
RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/011-privacy-settings.patch
@@ -121,6 +126,7 @@ RUN patch -u ${BASE_DIR}/apps/settings/lib/Sections/Personal/Groupware.php -i ${
RUN patch -u ${BASE_DIR}/apps/files/js/files.js -i ${TMP_PATCH_DIR}/021-repeated-storage-dialog-fix.patch
RUN cd ${BASE_DIR} && patch -u ${BASE_DIR}/3rdparty/sabre/vobject/lib/ITip/Broker.php -i ${TMP_PATCH_DIR}/022-significantchange.patch
RUN patch -u ${BASE_DIR}/apps/dav/lib/CalDAV/Reminder/ReminderService.php -i ${TMP_PATCH_DIR}/024-reminder-service-handle-exception.patch
RUN patch -u ${BASE_DIR}/apps/theming/lib/Themes/CommonThemeTrait.php -i ${TMP_PATCH_DIR}/026-primary-color-fix.patch

RUN rm -rf ${TMP_PATCH_DIR}

@@ -140,8 +146,6 @@ RUN curl -fsSL -o user_backend_sql_raw.tar.gz \

# Set default class of hidden to settings-hint
RUN sed -i 's/settings-hint/settings-hint hidden/' ${BASE_DIR}/apps/settings/templates/settings/personal/security/twofactor.php
# change notifications icon src
RUN sed -i 's/(0,Ud.imagePath)("notifications",e)/"\/themes\/"+OC.theme.folder+"\/apps\/notifications\/img\/"+e+".svg"/' ${BASE_DIR}/apps/notifications/js/notifications-main.js

RUN sed -i 's/ in Nextcloud/ /' ${BASE_DIR}/custom_apps/integration_google/js/integration_google-personalSettings.js
RUN sed -i 's/Nextcloud administrator/administrator/' ${BASE_DIR}/custom_apps/integration_google/js/integration_google-personalSettings.js
@@ -149,23 +153,26 @@ RUN sed -i 's/Nextcloud administrator/administrator/' ${BASE_DIR}/custom_apps/in
#replace error class in schedule response error file to fix error color
RUN sed -i 's/update/error/g' ${BASE_DIR}/apps/dav/templates/schedule-response-error.php

# Fix the navbar entries
RUN sed -i 's/this.appLimit=e/this.appLimit=this.appList.length/' ${BASE_DIR}/dist/core-main.js

From selfhost as ecloud
ARG BASE_DIR="/usr/src/nextcloud"
ARG TMP_PATCH_DIR="/tmp/build_patches"
ARG THEME_VERSION="24.0.4"
ARG LDAP_WRITE_SUPPORT_VERSION="1.6.0"
ARG OIDC_LOGIN_VERSION="2.4.0"
ARG THEME_VERSION="25.0.6"
ARG LDAP_WRITE_SUPPORT_VERSION="1.7.0"
ARG OIDC_LOGIN_VERSION="2.5.1"

# Patches
COPY patches/ ${TMP_PATCH_DIR}/
RUN patch -u ${BASE_DIR}/core/templates/layout.user.php -i ${TMP_PATCH_DIR}/003-contact-search-removal.patch
RUN patch -u ${BASE_DIR}/core/Controller/ContactsMenuController.php -i ${TMP_PATCH_DIR}/004-contact-search-controller-removal.patch
RUN cd ${BASE_DIR} && patch -p0 < ${TMP_PATCH_DIR}/005-autocomplete-user-leak-core.patch
RUN cd ${BASE_DIR}/custom_apps && patch -p0 < ${TMP_PATCH_DIR}/005-autocomplete-user-leak-custom-app.patch
RUN patch -u ${BASE_DIR}/core/templates/layout.guest.php -i ${TMP_PATCH_DIR}/016-login-screen.patch
RUN patch -u ${BASE_DIR}/lib/private/Notification/Manager.php -i ${TMP_PATCH_DIR}/020-fairuse-notification-fix.patch
RUN cd ${BASE_DIR} && patch -u ${BASE_DIR}/apps/user_ldap/lib/User_LDAP.php -i ${TMP_PATCH_DIR}/023-ldap-check-pwd-optimization.patch
RUN patch -u ${BASE_DIR}/lib/private/User/Manager.php -i ${TMP_PATCH_DIR}/025-optimize-get-by-email.patch
RUN patch -u ${BASE_DIR}/apps/dav/lib/Connector/Sabre/Principal.php -i ${TMP_PATCH_DIR}/027-displayname-user-leak-dav.patch
RUN rm -rf ${TMP_PATCH_DIR}

RUN curl -fsSL -o ldap_write_support.tar.gz \
@@ -182,13 +189,15 @@ RUN curl -fsSL -o oidc_login.tar.gz \
RUN sed -i 's/https:\/\/nextcloud.com\/signup\//https:\/\/e\.foundation\/<?php p(\$_\[\x27language\x27\]); ?>\/e-email-invite\//' ${BASE_DIR}/core/templates/layout.public.php

# show reset pwd page with a query param
RUN cd ${BASE_DIR}/dist && sed -i 's/resetPassword:!1/resetPassword:!1||Z.showResetPassword==="1"/' core-login.js
# RUN cd ${BASE_DIR}/dist && sed -i 's/resetPassword:!1/resetPassword:!1||Z.showResetPassword==="1"/' core-login.js

# hide oidc login button
RUN sed -i 's/$context->registerAlternativeLogin(OIDCLoginOption::class);/\/\/$context->registerAlternativeLogin(OIDCLoginOption::class);/' ${BASE_DIR}/custom_apps/oidc_login/lib/AppInfo/Application.php

# change notifications icon src
RUN sed -i 's/(0,zd.imagePath)("notifications",e)/"\/themes\/"+OC.theme.folder+"\/apps\/notifications\/img\/"+e+".svg"/' ${BASE_DIR}/apps/notifications/js/notifications-main.js
# add attr about how many notifications to notif icon
RUN sed -i 's/attrs:{id:"notifications",/attrs:{id:"notifications","data-has-notifications":0!==e.notifications.length,/' ${BASE_DIR}/apps/notifications/js/notifications-main.js
# Add data-object-type to notification
RUN sed -i 's/"data-id":e.notificationId,/"data-id":e.notificationId,"data-object-type":e.objectType,/' ${BASE_DIR}/apps/notifications/js/notifications-main.js

# autocomplete leak tweak apps frontend with sed, disable group suggestion

@@ -202,6 +211,7 @@ RUN sed -i 's/$this->header, \[$this->themingDefaults->getColorPrimary()/$this->
# Remove changeAvatar in changeUserHook of ldap_write_support as it throws errors
RUN sed -i 's/$this->changeAvatar/\/\/ $this->changeAvatar/' ${BASE_DIR}/custom_apps/ldap_write_support/lib/LDAPUserManager.php


# Remove 'fix broken values of calendar objects' repair step
RUN sed -i '/<step>OCA\\DAV\\Migration\\CalDAVRemoveEmptyValue<\/step>/d' ${BASE_DIR}/apps/dav/appinfo/info.xml

+55 −65
Original line number Diff line number Diff line
@@ -7,85 +7,75 @@ This patch auto append the domain handled by nc, configured in env var.
only the admin user (also configured in env var) will not have his login appended with a @domain suffix

diff --git ./core/Controller/LoginController.php ./core/Controller/LoginController-new.php
--- ./core/Controller/LoginController.php	2022-05-11 11:09:58.346364031 +0530
+++ ./core/Controller/LoginController-new.php	2022-05-30 19:32:45.195279817 +0530
@@ -303,6 +303,27 @@
 			return $this->generateRedirect($redirect_url);
--- ./core/Controller/LoginController.php	2023-04-21 15:08:54.979407062 +0530
+++ ./core/Controller/LoginController-new.php	2023-04-21 15:16:48.582366408 +0530
@@ -318,6 +318,26 @@
 				$this->l10n->t('Please try again')
 			);
 		}

+		$user = trim($user);
+        $user = mb_strtolower($user, 'UTF-8');
+		$domain = $this->config->getSystemValue('mail_domain', '');
+		$domain_suffix = !empty($domain) ? '@' . $domain : '';
+		$alt_domain = $this->config->getSystemValue('alt_mail_domain', '');
+		$alt_domain_suffix = !empty($alt_domain) ? '@'  . $alt_domain : '';
+        $legacyDomain = $this->config->getSystemValue('legacy_domain', '');
+        $legacyDomainSuffix = !empty($legacyDomain) ? '@' . $legacyDomain : '';
+        $mainDomain = $this->config->getSystemValue('main_domain', '');
+        $mainDomainSuffix = !empty($mainDomain) ? '@'  . $mainDomain : '';
+        $admin_username = $_ENV["NEXTCLOUD_ADMIN_USER"];
+        $is_admin = strcmp($user, $admin_username) === 0;
+        
+		if(!$is_admin && stristr($user, $domain_suffix) !== FALSE) {
+			$user = str_replace($domain_suffix, '', $user);
+		if (!$is_admin && str_ends_with($user, $legacyDomainSuffix)) {
+            $user = str_replace($legacyDomainSuffix, '', $user);
+        }
+
+		if (!$is_admin && stristr($user, $alt_domain_suffix) !== FALSE) {
+			$user = str_replace($alt_domain_suffix, '', $user);
+        if (!$is_admin && str_ends_with($user, $mainDomainSuffix)) {
+            $user = str_replace($mainDomainSuffix, '', $user);
+        }
+
+        if (!$this->userManager->userExists($user)) {
+			$user = $user . $domain_suffix;
+                $user = $user . $legacyDomainSuffix;
+        }
+
 
 		$data = new LoginData(
 			$this->request,
 			trim($user),
--- ./core/Controller/WebAuthnController.php	2022-08-18 10:33:16.150199100 +0530
+++ ./core/Controller/WebAuthnController-new.php	2022-08-18 10:34:31.880199100 +0530
@@ -37,6 +37,7 @@
 use OCP\ISession;
 use OCP\Util;
 use Webauthn\PublicKeyCredentialRequestOptions;
+use OCP\IUserManager;

 class WebAuthnController extends Controller {
 	private const WEBAUTHN_LOGIN = 'webauthn_login';
@@ -73,6 +74,25 @@
--- ./core/Controller/WebAuthnController.php	2023-04-21 15:18:58.813220092 +0530
+++ ./core/Controller/WebAuthnController-new.php	2023-04-21 15:24:40.036538414 +0530
@@ -66,6 +66,27 @@
 
 		$this->logger->debug('Converting login name to UID');
 		$uid = $loginName;
+
+		$uid = trim($uid);
+        $uid = mb_strtolower($uid, 'UTF-8');
+		$domain = \OC::$server->getConfig()->getSystemValue('mail_domain', '');
+		$domain_suffix = !empty($domain) ? '@' . $domain : '';
+		$alt_domain = \OC::$server->getConfig()->getSystemValue('alt_mail_domain', '');
+		$alt_domain_suffix = !empty($alt_domain) ? '@'  . $alt_domain : '';
+        $legacyDomain = \OC::$server->getConfig()->getSystemValue('legacy_domain', '');
+        $legacyDomainSuffix = !empty($legacyDomain) ? '@' . $legacyDomain : '';
+        $mainDomain = \OC::$server->getConfig()->getSystemValue('main_domain', '');
+        $mainDomainSuffix = !empty($mainDomain) ? '@'  . $mainDomain : '';
+        $admin_username = $_ENV["NEXTCLOUD_ADMIN_USER"];
+        $is_admin = strcmp($uid, $admin_username) === 0;
+        
+		if(!$is_admin && stristr($uid, $domain_suffix) !== FALSE) {
+			$uid = str_replace($domain_suffix, '', $uid);
+		if (!$is_admin && str_ends_with($uid, $legacyDomainSuffix)) {
+            $uid = str_replace($legacyDomainSuffix, '', $uid);
+        }
+		if (!$is_admin && stristr($uid, $alt_domain_suffix) !== FALSE) {
+			$uid = str_replace($alt_domain_suffix, '', $uid);
+
+        if (!$is_admin && str_ends_with($uid, $mainDomainSuffix)) {
+            $uid = str_replace($mainDomainSuffix, '', $uid);
+        }
+
+		if(!\OC::$server->get(IUserManager::class)->userExists($uid)) {
+			$uid = $uid . $domain_suffix;
+        if (!\OC::$server->get(\OCP\IUserManager::class)->userExists($uid)) {
+                $uid = $uid . $legacyDomainSuffix;
+        }
 		Util::emitHook(
 			'\OCA\Files_Sharing\API\Server2Server',
 			'preLoginNameUsedAsUserName',

--- ./lib/private/User/Session.php	2023-04-21 15:27:00.417034490 +0530
+++ ./lib/private/User/Session-new.php	2023-04-21 15:28:18.309111435 +0530
@@ -430,6 +430,10 @@
 		$remoteAddress = $request->getRemoteAddress();
 		$currentDelay = $throttler->sleepDelay($remoteAddress, 'login');
 
--- ./lib/private/User/Session.php	2022-08-10 15:39:33.131890282 +0530
+++ ./lib/private/User/Session-new.php	2022-08-10 15:48:23.236165783 +0530
@@ -438,7 +438,11 @@
 								IRequest $request,
 								OC\Security\Bruteforce\Throttler $throttler) {
 		$currentDelay = $throttler->sleepDelay($request->getRemoteAddress(), 'login');
-
+
+		$altDomain = $this->config->getSystemValue('alt_mail_domain', '');
+		$altDomainSuffix = !empty($altDomain) ? '@' . $altDomain : '';
+		$user = str_replace($altDomainSuffix, '', $user);
+		$mainDomain = $this->config->getSystemValue('main_domain', '');
+		$mainDomainSuffix = !empty($mainDomain) ? '@' . $mainDomain : '';
+		$user = str_replace($mainDomainSuffix, '', $user);
+
 		if ($this->manager instanceof PublicEmitter) {
 			$this->manager->emit('\OC\User', 'preLogin', [$user, $password]);
+8 −15
Original line number Diff line number Diff line
@@ -5,20 +5,13 @@ Subject: [PATCH] remove user search icon in header tab
This patch removes the top right icon enabling the global user search function available to all in nextcloud.

diff --git layout.user.php layout.user.php-new
--- layout.user.php	2021-06-22 14:06:34.786843164 +0530
+++ layout.user.php-new	2021-06-22 14:07:45.938569109 +0530
@@ -103,14 +103,6 @@

--- ./core/templates/layout.user.php	2023-03-28 14:54:05.873566570 +0530
+++ ./core/templates/layout.user-new.php	2023-03-28 14:54:35.044218831 +0530
@@ -76,7 +76,6 @@
 			<div class="header-right">
 				<div id="unified-search"></div>
-				<div id="contactsmenu">
-					<div class="icon-contacts menutoggle" tabindex="0" role="button"
-					aria-haspopup="true" aria-controls="contactsmenu-menu" aria-expanded="false">
-						<span class="hidden-visually"><?php p($l->t('Contacts'));?></span>
-					</div>
-					<div id="contactsmenu-menu" class="menu"
-						aria-label="<?php p($l->t('Contacts menu'));?>"></div>
-				</div>
 				<div id="settings">
 					<div id="expand" tabindex="0" role="button" class="menutoggle"
 						aria-label="<?php p($l->t('Settings'));?>"
 				<div id="notifications"></div>
-				<div id="contactsmenu"></div>
 				<div id="user-menu"></div>
 			</div>
 		</header>
+8 −8
Original line number Diff line number Diff line
@@ -5,21 +5,21 @@ Subject: [PATCH] do not return these results in user search
This patch removes some results from the contact menu controller, not to leak user informations

diff --git ContactsMenuController.php ContactsMenuController-new.php
--- ContactsMenuController.php	2021-02-04 10:20:18.000000000 +0100
+++ ContactsMenuController-new.php	2021-02-04 10:30:13.000000000 +0100
@@ -58,7 +58,7 @@
 	 * @return \JsonSerializable[]
--- ./core/Controller/ContactsMenuController.php	2023-02-01 21:40:07.515628276 +0530
+++ ./core/Controller/ContactsMenuController-new.php	2023-02-01 21:39:07.398140201 +0530
@@ -49,7 +49,7 @@
 	 * @throws Exception
 	 */
 	public function index($filter = null) {
 	public function index(?string $filter = null): array {
-		return $this->manager->getEntries($this->userSession->getUser(), $filter);
+		return [];
 	}
 
 	/**
@@ -69,11 +69,6 @@
 	 * @return JSONResponse|\JsonSerializable
@@ -59,11 +59,6 @@
 	 * @throws Exception
 	 */
 	public function findOne($shareType, $shareWith) {
 	public function findOne(int $shareType, string $shareWith) {
-		$contact = $this->manager->findOne($this->userSession->getUser(), $shareType, $shareWith);
-
-		if ($contact) {
+61 −61
Original line number Diff line number Diff line
@@ -29,17 +29,17 @@ diff --git lib/private/Collaboration/Collaborators/UserPlugin.php lib/private/Co
 					$foundUserById = true;

diff --git lib/private/Collaboration/Collaborators/MailPlugin.php lib/private/Collaboration/Collaborators/MailPlugin-new.php
--- lib/private/Collaboration/Collaborators/MailPlugin.php	2022-11-23 15:20:44.460495300 +0530
+++ lib/private/Collaboration/Collaborators/MailPlugin-new.php	2022-11-23 16:55:17.540495300 +0530
@@ -36,6 +36,7 @@
 use OCP\IConfig;
 use OCP\IGroupManager;
 use OCP\IUser;
+use OCP\IUserManager;
--- lib/private/Collaboration/Collaborators/MailPlugin.php	2023-02-01 21:43:07.661060529 +0530
+++ lib/private/Collaboration/Collaborators/MailPlugin-new.php	2023-02-01 21:51:00.382603635 +0530
@@ -39,6 +39,7 @@
 use OCP\IUserSession;
 use OCP\Share\IShare;
 use OCP\Mail\IMailer;
@@ -76,13 +77,15 @@
+use OCP\IUserManager;
 
 class MailPlugin implements ISearchPlugin {
 	/* @var bool */
@@ -76,7 +77,8 @@
 								IGroupManager $groupManager,
 								KnownUserService $knownUserService,
 								IUserSession $userSession,
@@ -49,32 +49,31 @@ diff --git lib/private/Collaboration/Collaborators/MailPlugin.php lib/private/Co
 		$this->contactsManager = $contactsManager;
 		$this->cloudIdManager = $cloudIdManager;
 		$this->config = $config;
 		$this->groupManager = $groupManager;
@@ -84,6 +86,7 @@
 		$this->knownUserService = $knownUserService;
 		$this->userSession = $userSession;
+		$this->userManager = $userManager;
 		$this->mailer = $mailer;
+		$this->userManager = $userManager;
 
 		$this->shareeEnumeration = $this->config->getAppValue('core', 'shareapi_allow_share_dialog_user_enumeration', 'yes') === 'yes';
@@ -224,27 +227,63 @@
 		$this->shareWithGroupOnly = $this->config->getAppValue('core', 'shareapi_only_share_with_group_members', 'no') === 'yes';
@@ -230,27 +233,61 @@
 						if ($exactEmailMatch) {
 							$searchResult->markExactIdMatch($emailType);
 						}
-						$result['exact'][] = [
-							'label' => $displayName,
-							'uuid' => $contact['UID'],
-							'name' => $contact['FN'],
-							'uuid' => $contact['UID'] ?? $emailAddress,
-							'name' => $contact['FN'] ?? $displayName,
-							'type' => $emailAddressType ?? '',
-							'value' => [
-								'shareType' => IShare::TYPE_EMAIL,
-								'shareWith' => $emailAddress,
-							],
-						];
+
+						$isUserinInstance = $this->userManager->get($emailAddress);
+						if ($isUserinInstance === null) {
+						// /e/ user is not in ecloud
+
+							$result['exact'][] = [
+								'label' => $displayName,
+								'uuid' => $contact['UID'],
@@ -102,8 +101,8 @@ diff --git lib/private/Collaboration/Collaborators/MailPlugin.php lib/private/Co
 					} else {
-						$result['wide'][] = [
-							'label' => $displayName,
-							'uuid' => $contact['UID'],
-							'name' => $contact['FN'],
-							'uuid' => $contact['UID'] ?? $emailAddress,
-							'name' => $contact['FN'] ?? $displayName,
-							'type' => $emailAddressType ?? '',
-							'value' => [
-								'shareType' => IShare::TYPE_EMAIL,
@@ -140,3 +139,4 @@ diff --git lib/private/Collaboration/Collaborators/MailPlugin.php lib/private/Co
 					}
 				}
 			}
Loading