mail icon indicating copy to clipboard operation
mail copied to clipboard

Provisioning does not replace %USERID% in mail host

Open Netspider opened this issue 5 years ago • 6 comments

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.

Netspider avatar Feb 26 '20 20:02 Netspider

Can be fixed at https://github.com/nextcloud/mail/blob/11a5d64c418cb241a6f2a1f0564f28610d9a73e4/lib/Service/Provisioning/Config.php#L55

ChristophWurst avatar Feb 27 '20 07:02 ChristophWurst

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.

TCB13 avatar May 06 '23 22:05 TCB13

This is a serious bug... cmon.

https://github.com/nextcloud/mail/blob/3d118f2a0a9f19127e1b69ad331997dc3a5042c5/lib/Db/Provisioning.php#L155-L157 your users have no email address set. Therefore there is nothing to replace with.

ChristophWurst avatar May 09 '23 07:05 ChristophWurst

This is a serious bug... cmon.

https://github.com/nextcloud/mail/blob/3d118f2a0a9f19127e1b69ad331997dc3a5042c5/lib/Db/Provisioning.php#L155-L157 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...

TCB13 avatar May 09 '23 11:05 TCB13

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

ChristophWurst avatar May 09 '23 14:05 ChristophWurst

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!

TCB13 avatar May 09 '23 23:05 TCB13