-
Notifications
You must be signed in to change notification settings - Fork 67
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
[IMAP] login without domain is alowed and creates new users #128
Comments
don't get me wrong, it may be ok adding the domain to be more relaxed for login, but then it must also add the domain for the but IMHO this is not a good practice, if your IMAP-server refuses connection without a domain... because i prefer a consistent UX over one service with a more relaxed login. yes, there may be corner cases where this behavior may be interesting resp. nice... like the same users with different domains (but then you would set domain stripping to so bottom line: i would kick the (not expected) adding of the domain at all to be on the safe side and don't further fiddle around with it. |
btw: can someone give me a hint/advise to clean up the incurred mess? |
yes, I guess this makes sense!
actually this I don't know... we would need a more experienced Nextcloud core dev for this... |
well taking a closer look at the code it seems this (adding the domain part to the uid for the authentication against the imap server) was indeed implemented intentionally... |
so I guess the best thing to do would be to only add the domain to the user part if Domain stripping is active... right? |
maybe @kosli is still around and remembers the decisions made when implementing this? |
@violoncelloCH I think that is what exactly was the purpose of that functionality. e.g. I have one Nextcloud instance for a specific association, and only users from the associated mail-domain should be able to login to the nextcloud server. and I like to have the uid created without the domain. I see that there are to options on the IMAP module: |
first of all sorry for being silent so long, but i lost track of this issue until some of my users experienced it yet again.
well... i would already have done it myself, if i only could! - unfortunately i'm just an admin, not a developer and everything above (excessive) shell-scripting exceeds my skills. 😞
@violoncelloCH i also guessed something like that... but with more than one user with the same username (ahead of the domain), this becomes a serious security issue (beside of creating new
that's not the topic... i've got at one instance indeed a similar setup. that's what domain stripping is for, but the issue is the "domain adding"! and if @kosli meant the convenience for users to just type in their username (without the domain), i'm still not sure about this use-case... as already mentioned: i would strongly advise against creating a different UX if the IMAP server doesn't allow a login without the domain! and even more important: if you are using more the one domain (resp. the IMAP backend more than once), which domain gets added?!? 😕 |
perhaps @jospoortvliet can give a hint whom to ask resp. raise someone’s attention directly who can determine if this is a nextcloud core issue or intended (and if so, why)? |
This is still an issue when trying to connect via caldav. Although it denies the login, the account is created. Steps to reproduce:
|
So i have multiple domains on my email server. I created two same usernames on two different domains. Logging in with the username only with two different passwords will log me in on the same account. Definitely this plugin is not intended to be used on the same email server having multiple domains. |
I found a workaround to the issue. Configure like this: Then, edit the lib/imap.php: This way it will not attempt to create another username nor will check valid password against other domains. |
Since the uid is returned and this one is used afterwards, I am able to change it inside of the script. Changing line 67 in - $username = $uid . '@' . $this->domain;
+ $uid = $uid . '@' . $this->domain;
+ $username = $uid; Of course this means that the uid will always contain the domain it was first successfully checked against. As there always had been one domain for me and all used to register including the domain, I had no issues so far. |
Steps to reproduce
user_external
as further below (especially withfalse
for domain stripping).[email protected]
and everything seems to work as it should: new users get automatically created withuid
[email protected]
.also the tables
users_external
,accounts
andcredentials
seem fine...user
with the same (correct) password: then a new user withuid
user
gets created and seems to work like a normal nextcloud-user, although a login without the domain does not work at the plain IMAP-server! 😲but i've deleted them all and this bug seems to "work" also for completely new users.
Expected behaviour
user_external should IMHO not add the domain for authentication and even more important not strip it for the nextcloud
uid
especially if it is configured to haveuid
s with domain!in best case this creates confusion or panic at the users and is just annoying for admins... but in the worst case with more than one
user_backends
resp. domain, this creates a hell of a mess and serious trouble!Actual behaviour
see Steps to reproduce
Affected Authentication backend
at least IMAP (i don't use other)
Server configuration
User External App version: (see Nextcloud apps page)
0.8.0
Operating system:
ubuntu
Web server:
apache
Database:
mysql 5.7.28
PHP version:
7.2.24
Nextcloud version: (see Nextcloud admin page)
16.0.8.1
Updated from an older Nextcloud/ownCloud or fresh install:
updated from at least NC13
Where did you install Nextcloud from:
hoster script
Signing status:
Signing status
List of activated apps:
App list
Nextcloud configuration:
Config report
Logs
Web server error log
Web server error log
Nextcloud log (data/nextcloud.log)
Nextcloud log
Browser log
Browser log
The text was updated successfully, but these errors were encountered: