YunoHost / issues

General issue tracker for the YunoHost project
71 stars 8 forks source link

Return the appropriate username during mail autoconfig #1707

Open zamentur opened 3 years ago

zamentur commented 3 years ago

We still have an autoconfig mechanism for email client configuration.

However if the local part of the email is not equal to the username, the autoconfiguration fails.

Exemple:

username : camille
email: camille.doe@example.com

The autoconfig requested is

GET /.well-known/autoconfig/mail/config-v1.1.xml?emailaddress=camille.doe%40example.com

But our current config return in username tags:

<username>%EMAILLOCALPART%</username>

=> camille.doe => So the autoconfig fails

If the autoconfig was generated dynamically with PHP or another techno (lua ?), it could be:

<username>camille</username>

Doc: https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Autoconfiguration/FileFormat/HowTo#Username

alexAubin commented 3 years ago

(Alternatively we could decide to switch to login = the full email address, dunno if that's better or worse)

npalix commented 1 year ago

In that case, it should exist a 'camille@example.com' canonical address used for the email client configuration. 'camille.doe@example.com' will be a user defined alias if requested by the user.

From a RFC point of view, https://datatracker.ietf.org/doc/html/draft-daboo-srv-email-02#section-5 "IMAP, POP3, and SMTP (submission) servers SHOULD be configured to allow authentication with email addresses or email local-parts."

According to, https://wiki.mozilla.org/Thunderbird:Autoconfiguration:ConfigFileFormat The goal is to stick to a static file, and the 'right' value for that use case seems to be either %REALNAME% or %USERNAME%.

So, pick your solution, but their is not need to make it dynamic.

zamentur commented 1 year ago

In that case, it should exist a 'camille@example.com' canonical address used for the email client configuration. 'camille.doe@example.com' will be a user defined alias if requested by the user. It's the case when the user is created. But the admin can change the email with yunohost user update.

So you suggest we remove the possibility to change the first email of a user with yunohost user update ?

npalix commented 1 year ago

It sound good for me to preserve the canonical address, and it's a simple way to ensure the autoconfig is working without changing it.

If the main email address is editable, then an alternative is to present the connection information to pass to the user (full email address) as the email server "SHOULD" allow email-based authentication. But the email server configuration must be checked then (is it currently working?). Finally, the autoconfig can switch to "%EMAILADDRESS%" instead of "%EMAILLOCALPART%. That way the autoconfig remains static.

eldertek commented 1 year ago

I think should be closed as autoconfig in this case working.