Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloud Login-Id: Option for username only (no appended @domain) #25

Open
amessina opened this issue Mar 30, 2024 · 3 comments
Open

Cloud Login-Id: Option for username only (no appended @domain) #25

amessina opened this issue Mar 30, 2024 · 3 comments

Comments

@amessina
Copy link

My setup uses usernames only (without @Domain). I'd like to pin the roundcubemail login to the Nextcloud login. However, when leaving the domain portion empty, the login to my email server still contains "username@" which includes the "@" -- would it be possible to not include the "@" when the Cloud Login-Id has an empty domain?

@c-schwamborn
Copy link

c-schwamborn commented Apr 9, 2024

Second that. I'm running a Nextcloud instance at a university and stumbled across the same issue.
I think the changes would be simple:

diff -Naur lib/Settings/Personal.php.orig lib/Settings/Personal.php
--- lib/Settings/Personal.php.orig	2024-04-09 13:07:06.015431774 +0200
+++ lib/Settings/Personal.php	2024-04-09 13:07:51.406876862 +0200
@@ -71,7 +71,7 @@
     switch ($emailAddressChoice) {
       case 'userIdEmail':
         $userEmail = $this->user->getUID();
-        if (strpos($userEmail, '@') === false) {
+        if (strpos($userEmail, '@') === false && !empty($emailDefaultDomain)) {
           $userEmail .= '@'.$emailDefaultDomain;
         }
         break;
diff -Naur lib/Service/Config.php.orig lib/Service/Config.php
--- lib/Service/Config.php.orig	2024-04-09 13:06:24.691936956 +0200
+++ lib/Service/Config.php	2024-04-09 13:05:47.220395060 +0200
@@ -310,11 +310,11 @@
     $userEmail = null;
     $userPassword = null;
     $emailAddressChoice = $this->getAppValue('emailAddressChoice', 'userPreferencesEmail');
+    $emailDefaultDomain = $this->getAppValue('emailDefaultDomain', '');
     switch ($emailAddressChoice) {
       case self::EMAIL_ADDRESS_CHOICE_USER_ID:
         $userEmail = $this->user->getUID();
-        if (strpos($userEmail, '@') === false) {
-          $emailDefaultDomain = $this->getAppValue('emailDefaultDomain', '');
+        if (strpos($userEmail, '@') === false && !empty($emailDefaultDomain)) {
           $userEmail .= '@'.$emailDefaultDomain;
         }
         break;

@rotdrop
Copy link
Owner

rotdrop commented Sep 6, 2024

Second that. I'm running a Nextcloud instance at a university and stumbled across the same issue. I think the changes would be simple:

diff -Naur lib/Settings/Personal.php.orig lib/Settings/Personal.php
--- lib/Settings/Personal.php.orig	2024-04-09 13:07:06.015431774 +0200
+++ lib/Settings/Personal.php	2024-04-09 13:07:51.406876862 +0200
@@ -71,7 +71,7 @@
     switch ($emailAddressChoice) {
       case 'userIdEmail':
         $userEmail = $this->user->getUID();
-        if (strpos($userEmail, '@') === false) {
+        if (strpos($userEmail, '@') === false && !empty($emailDefaultDomain)) {
           $userEmail .= '@'.$emailDefaultDomain;
         }
         break;
diff -Naur lib/Service/Config.php.orig lib/Service/Config.php
--- lib/Service/Config.php.orig	2024-04-09 13:06:24.691936956 +0200
+++ lib/Service/Config.php	2024-04-09 13:05:47.220395060 +0200
@@ -310,11 +310,11 @@
     $userEmail = null;
     $userPassword = null;
     $emailAddressChoice = $this->getAppValue('emailAddressChoice', 'userPreferencesEmail');
+    $emailDefaultDomain = $this->getAppValue('emailDefaultDomain', '');
     switch ($emailAddressChoice) {
       case self::EMAIL_ADDRESS_CHOICE_USER_ID:
         $userEmail = $this->user->getUID();
-        if (strpos($userEmail, '@') === false) {
-          $emailDefaultDomain = $this->getAppValue('emailDefaultDomain', '');
+        if (strpos($userEmail, '@') === false && !empty($emailDefaultDomain)) {
           $userEmail .= '@'.$emailDefaultDomain;
         }
         break;

Hi there,

it it is just this: can you please generate a PR and I will be more than glad to just accept it.

Thank you!

Best regards

Claus

@c-schwamborn
Copy link

c-schwamborn commented Sep 9, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants