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

Need help #1

Open
vpsinghbaghel opened this issue Sep 23, 2020 · 4 comments
Open

Need help #1

vpsinghbaghel opened this issue Sep 23, 2020 · 4 comments

Comments

@vpsinghbaghel
Copy link

Could you please explain how to use these files to generate auto-config script for particular domain and email address for any mail client application.
I have read your description but didn't understand how can we generate the config script using these files.

Please help.
Best Regards.
Ved.

@davidlj95
Copy link
Contributor

Hi, thanks for your interest in the project.

Basic TL;DR would be: serve those files where the email client will look for them with a PHP server + some DNS configs.

I'll detail a little bit on every email client.

For sake of clarity, I'll say the email domain for which we want to setup autoconfiguration is mail.example.org. So an example email address would be user@mail.example.org

Thunderbird

An http://autoconfig.mail.example.org/mail/config-v1.1.xml has to resolve to the xml file you'll find in this repo. You can try that in the browser and see if you get the XML with the right email settings.

So: you'll have to be able to serve things at the subdomain autoconfig.mail.example.org and the file /mail/config-v1.1.xml will have to return the email settings. Pretty easy this one!

Outlook

Things get little bit difficult here: there's a POST instead of a GET request + the domain can be configured.

To specify the domain where you'll serve the autoconfig file you need to create the DNS entry specified in the guide in the main domain. You can use autoconfig as subdomain so that you share the same subdomain for both Thunderbird and Outlook. We'll suppose you choose autoconfig.

Then the DNS record to create is

Service Protocol Value, Destination, Target Port Priority Weight TTL
_autodiscover _tcp autoconfig 443 5 0 3600

After that, a POST request to https://autoconfig.mail.example.org/Autodiscover/Autodiscover.xml will have to return the email settings for a specific email address. The code there is to extract the email address for which the email settings are. It's hardcoded so that they are the same settings for all email addresses, so the response just includes the email address sent in the POST request.

As you can see in the README, there's a link to a Microsoft tool so you can check if the request and response is working as expected.

⚠️ Notice HTTPS here, so you'll have setup the web server to use SSL/TLS with a valid certificate. For a free one, you can use letsencrypt.org

iOS / macOs Email client

The iOS / macOs email client has no autoconfig protocol (probably wrong here :S didn't spend much time on this ), so you'll have to provide the user a .mobileconfig configuration file that they can import so all config is filled for them except the password.

To do so our approach is to give the user a link to a .mobileconfig file with the email settings for a specific user. To do so, what we've done is a script that based on the ?email= GET query param you will get a .mobileconfig for that email address. You can serve that file where you want, and then send that to the user so they can install the settings in their computer.

For instance, if we serve that from the server at autoconfig.mail.example.org, we could place the files at the root of the server and then send each user a link to http://autoconfig.mail.example.org/email.mobileconfig?email=user@mail.example.org so that they can download the config file and open it to set all settings for a new account in the email client.

Also, check the links regarding the sources of the doc at the end of the README, that's where we extracted all the info.

Hope to have helped!

@davidlj95
Copy link
Contributor

davidlj95 commented Sep 23, 2020

I have read your description but didn't understand how can we generate the config script using these files.

A TL;DR would be: for Thunderbird and Outlook, you have to be able to have a server replying to HTTP GET/POST over HTTP/HTTPS requests respectively. For iOS/macOS, you can grab the XML inside index.php at the email.mobileconfig dir and replace the email part for every user you want the config to. For this to be dynamic, we thought to serve it along with the other autoconfigs so that the file can be autogenerated based on the email query param.

@vpsinghbaghel
Copy link
Author

vpsinghbaghel commented Sep 24, 2020 via email

@axoroll7
Copy link

Hi David, Thanks a lot for your kind response on my query. I am actually looking for iOS and Mac. To do so our approach is to give the user a link to a .mobileconfig file with the email settings for a specific user. To do so, what we've done is a script that based on the ?email= GET query param you will get a .mobileconfig for that email address. You can serve that file where you want, and then send that to the user so they can install the settings in their computer. I still didn't understand how to generate that config file for each email address. I understood that I have to send the file manually to the user or I have to provide a link from where the user can download his configuration file. I am absolutely fine to do that. But still not understanding how to create that .mobileconfig file for a user. Please help. Best Regards. Ved.

I am not affiliated with the creator of this repository. When I upload the file "index.php" from GitHub to my webserver at "/email.mobileconfig/index.php", the profile file is generated automatically when I enter the URL : "https://my_domain/email.mobileconfig?email=my_emailaddress".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants