Hello everyone, I hope I’m not asking a question I could have found the answer somewhere, but I didn’t so I try here
The YNH instance I’m referring to after is installed in a vm and therefore the main machine has a firewall forwarding requests to YNH and other vms.
In order for a mail client to be able to configure automatically IMAP and SMTP ports, when configuring an account, I think it has to make a request to the server. I guess that this request is probably made to mydomain.tld/some/path/ but the firewall of the main machine is probably blocking it which make autoconfiguration fail, and users have to fill in the configuration manually, which is not obvious for many people.
I was wondering what is the url mydomain.tld/some/path/ that fetches the autoconfiguration file, so I can forward it to the YNH vm from the main machine.
Any idea how I can figure out what is that url?
Hey, thank you
Checking the logs of the main machine, I can see a request to domain.tld/.well-known/autoconfig/mail/config-v1.1.xml but it keeps answering 404 even when I forward it to the vm. I tried requesting yunohost.domain.tld/.well-known/autoconfig/mail/config-v1.1.xml with the browser (yunohost.domain.tld forwards everything to YNH vm) and it also reply 404 and thunderbird still cannot fetch the config.
If I try yunohost.domain.tld/.well-known/domain.tld/autoconfig/mail/config-v1.1.xml in the browser, it forwards to the SSO (even when logged in). Not sure what’s going one.
Yep, the file exists (/var/www/.well-known/domain.tld/autoconfig/mail/config-v1.1.xml), and it seem to contain what it should (from what I can imagine).
So I don’t understand why when I check the url it redirects to the SSO, and secondly, I don’t see how thunderbird could find the config even if it was returned, since thunderbird seem to make a request without the “domain.tld” part (= it requests /.well-known/autoconfig/mail/config-v1.1.xml).
I ran to fast yunohost service regen-conf nginx before seeing you proposed also yunohost service regen-conf nginx --dry-run -d, so I didn’t get the diff, but with up to date nginx config, the problem remains.
Well eh okay, I think if you want to investigate further then maybe running grep -nr "well-known" /etc/nginx/ will point you to the corresponding line, and then you can try to see if the right locations are pointing to the right files …
It looks like this, which seemed to make sense to me
location /.well-known/autoconfig/mail/ {
alias /var/www/.well-known/domain.tld/autoconfig/mail/;
}
From this I understand that if I request domain.tld/.well-known/autoconfig/mail/config-v1.1.xml I should get the config properly, and not be redirected to yunohost SSO, no?
Also requesting yunohost.domain.tld/.well-known/autoconfig/mail/config-v1.1.xml I should get another config for the subdomain yunohost.domain.tld.
Ok, I wanted to ask at the beginning if it could be a problem if the request is https, but I didn’t, but the whole problem must come from that, because the firewall of the main machine is caddy and is making all traffic automatically htttps.
Well trying with K9 mail, by default it configures SSL/TLS and port 465 for sending. So maybe there’s still a problem I don’t know, but I guess if there is it must come from my caddy https/http configuration that’s right and not from yunohost.