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

Provisioning does not replace %USERID% in mail host #2698

Open
Netspider opened this issue Feb 26, 2020 · 6 comments
Open

Provisioning does not replace %USERID% in mail host #2698

Netspider opened this issue Feb 26, 2020 · 6 comments
Labels
1. to develop enhancement enterprise Features and bugs relevant for enterprise installations mostly help wanted

Comments

@Netspider
Copy link

Netspider commented Feb 26, 2020

Expected behavior

%USERID% (and %EMAIL%) can be used in IMAP/SMTP host and will be replaced by the values for each user.

Actual behavior

the host in the preview and in the db table oc_mail_accounts is literally "%USERID%"

Mail app

Mail app version: 1.1.2

Mailserver or service: Postfix / Dovecot

Server configuration

Operating system: Debian 9

Web server: Apache2

Database: MariaDB

PHP version: 7.4

Nextcloud Version: 18.0.1

Client configuration

Browser: Chrome

Operating system: Windows 10


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@ChristophWurst ChristophWurst added 1. to develop enhancement enterprise Features and bugs relevant for enterprise installations mostly help wanted and removed 0. to triage bug labels Feb 27, 2020
@ChristophWurst
Copy link
Member

Can be fixed at

return $this->data['imapHost'];

@TCB13
Copy link

TCB13 commented May 6, 2023

This is a serious bug... cmon.

Did you ever get the provisioning working with the %EMAIL% pattern? It seems broken to me:

settings

And when I go to the Mail tab it just stays loading for a very long time and ends up in this:

webmail

My Dovecot says Nextcloud is trying to login with the placeholder lol

 dovecot[9155]: imap-login: Disconnected (auth failed, 4 attempts in 35 secs): **user=<%EMAIL%>**, method=PLAIN, rip=10.10.125.7, lip=10.10.125.4, TLS, session=<AlQT2gv7JOcKCn0H>

It says that “* %USERID% and %EMAIL% will be replaced with the user’s UID and email” but apparently it doesn’t replace the %EMAIL% placeholder with the login email as we can see on the log.

Note: my users will login with 2 different domains using their full e-mail address. The IMAP and SMTP require login with the full e-mail as well.

@ChristophWurst
Copy link
Member

This is a serious bug... cmon.

if ($user->getEMailAddress() !== null) {
$original = str_replace('%EMAIL%', $user->getEMailAddress(), $original);
}
your users have no email address set. Therefore there is nothing to replace with.

@TCB13
Copy link

TCB13 commented May 9, 2023

This is a serious bug... cmon.

if ($user->getEMailAddress() !== null) {
$original = str_replace('%EMAIL%', $user->getEMailAddress(), $original);
}

your users have no email address set. Therefore there is nothing to replace with.

How come? They login to Nextcloud with their e-mail.

In my setup Nextcloud is configured to authenticate users against an IMAP server , unless I'm missing something there's no reason why the email would be missing...

@ChristophWurst
Copy link
Member

Sounds like you are using the email as login name and should rather map %USERID% to the imap username.

@TCB13
Copy link

TCB13 commented May 9, 2023

Sounds like you are using the email as login name and should rather map %USERID% to the imap username.

Hm, I'll give it a try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop enhancement enterprise Features and bugs relevant for enterprise installations mostly help wanted
Projects
None yet
Development

No branches or pull requests

3 participants