Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


    Cloudron Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Solved email: autoconfig for autoconfiguration (example: via thunderbird)

    Feature Requests
    email thunderbird
    6
    22
    2455
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • valkalon
      valkalon last edited by girish

      Hi guys, I'm a standard cloudron subscription user.

      I've just set up emails using cloudron everything worked perfectly. I had to setup email server and experienced the pain it can be to have everything working smoothly and secure. Thank you so much for taking car of all the hassle with the cloudron, it's amazing 🙂

      Question: I'm using Thunderbird and it was not able to automatically detect cloudron settings, I had to set it up manually. i'm tech savvy so it's fine by me, it won't be the same though for family and friends.

      Is there any chance that you would add autoconfig to the email part of cloudron so that thunderbird (and equivalent mail client) would automatically find the configuration?

      1 Reply Last reply Reply Quote 5
      • subven
        subven last edited by

        This works with a service subdomain + SRV record and is AFAIK not implemented in Cloudron yet.

        Ressources:

        • https://docs.microsoft.com/en-us/openspecs/exchange_server_protocols/ms-oxdisco/d912502b-c0e2-41a1-8b0e-f714ba523e08
        • https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Autoconfiguration
        • https://help.directadmin.com/item.php?id=661
        • http://web.archive.org/web/20120828065248/http://moens.ch/2012/05/31/providing-email-client-autoconfiguration-information/
        1 Reply Last reply Reply Quote 3
        • girish
          girish Staff last edited by

          This is in our TODO list: https://git.cloudron.io/cloudron/box/issues/556 . I have added @subven suggestion there now.

          1 Reply Last reply Reply Quote 4
          • valkalon
            valkalon last edited by

            Understood thanks a lot!

            1 Reply Last reply Reply Quote 0
            • valkalon
              valkalon last edited by valkalon

              I had autoconfig setup for business emails before cloudron. Here is the process I used:

              Let's say you have the following domains:
              test.com: The domain for which you want to have email autoconfig
              my.test.com: The URL of your cloudron server that manages your email and will broadcast the autoconfig configuration.

              setup DNS entries in the test.com DNS

              // entry for outlook (never tested since I only use thunderbird)
              _autodiscover._tcp 600 IN SRV 0 0 443 my.test.com
              // entry for thunderbird and others
              autoconfig 600 IN CNAME my.test.com
              smtp 600 IN CNAME my.test.com
              imap 600 IN CNAME my.test.com

              // autoconfig.test.com does not need an SSL certificate
              // smtp.test.com, imap.test.com must have an active SSL certificate

              Create the mail directory and autoconfig file

              in the webroot for autoconfig.test.com create the file

              mail/config-v1.1.xml

              Content of mail/config-v1.1.xml

              // Here is a sample:

              <?xml version="1.0" encoding="UTF-8"?>
              
              <clientConfig version="1.1">
                <emailProvider id="my.test.com">
                  <domain>test.com</domain> 
                  <domain>another-domain.com</domain>
                  <displayName>test.com</displayName>
                  <displayShortName>Test</displayShortName>
                  <incomingServer type="imap">
                    <hostname>imap.test.com</hostname>
                    <port>993</port>
                    <socketType>SSL</socketType>
                    <authentication>password-cleartext</authentication>
                    <username>%EMAILADDRESS%</username>
                  </incomingServer>
                  <outgoingServer type="smtp">
                    <hostname>smtp.test.com</hostname>
                    <port>587</port>
                    <socketType>STARTTLS</socketType>
                    <authentication>password-cleartext</authentication>
                    <username>%EMAILADDRESS%</username>
                  </outgoingServer>
                </emailProvider>
              </clientConfig>
              

              Nginx config

              since autoconfig does not require any SSL certificate you can setup any autoconfig request to match the same config file. For cloudron it might be better to have one config file per domain?

              server {
                listen 80;
                server_name
                autoconfig.*;
              
                root /var/www/autoconfig.test.com;
                access_log /var/log/nginx/autoconfig.test.com/access.log;
                error_log /var/log/nginx/autoconfig.test.com/error.log warn;
              
                location / {
                  try_files $uri $uri/;
                }
              }
              

              Aside note

              in theory you should be able to not use imap.test.com and smtp.test.com, in practice though, I had trouble with thunderbird not recognizing the autoconfig without those 2 domains setup (it was 1 year ago, maybe it changed since)

              Hope it helps! I'll be happy to assist implementing if interested 😉

              1 Reply Last reply Reply Quote 2
              • girish
                girish Staff last edited by

                I have put instructions how to setup autoconfig for Thunderbird and Outlook here - https://cloudron.io/documentation/email/#autodiscover . I tested Thunderbird and that works well. I couldn't test Outlook because it seems old Outlook is not downloadable anymore and Outlook 365 uses some undocumented autodiscover.json method these days.

                1 Reply Last reply Reply Quote 2
                • valkalon
                  valkalon last edited by

                  Awesome Girish thanks a lot !

                  1 Reply Last reply Reply Quote 0
                  • subven
                    subven last edited by subven

                    Very nice to see this finally beeing resolved and documentated. Thank you a lot @valkalon and @girish 🙂

                    1 Reply Last reply Reply Quote 0
                    • H
                      hakunamatata last edited by

                      Hello, I have followed the instructions in the cloudron documentation and successfully set up autoconfig for my primary domain (domain1.com). Thanks for that!

                      I am also hosting other domains (domain2.com, domain3.com), on my cloudron server and was wondering how I could set autoconfig for them as well.

                      Do I create a similar config-v1.1.xml files on autoconfig.domain2.com, autoconfig.domain3.com etc or can I somehow edit the autoconfig.domain1.com/mail/config-v1.1.xml to include the additional domains?

                      robi girish 2 Replies Last reply Reply Quote 1
                      • robi
                        robi @hakunamatata last edited by

                        @hakunamatata they would be separate. Hence the use of the first method may be better for a multi-domain setup.

                        Life of Advanced Technology

                        1 Reply Last reply Reply Quote 0
                        • robi
                          robi last edited by

                          This looks like it should simply be a checkbox in the UI, and Cloudron manages the ~yellowtent/boxdata/well-known/<domains> hierarchy.

                          Was that the plan @staff ?

                          Life of Advanced Technology

                          girish 1 Reply Last reply Reply Quote 2
                          • girish
                            girish Staff @hakunamatata last edited by

                            @hakunamatata said in email: autoconfig for autoconfiguration (example: via thunderbird):

                            Do I create a similar config-v1.1.xml files on autoconfig.domain2.com, autoconfig.domain3.com etc or can I somehow edit the autoconfig.domain1.com/mail/config-v1.1.xml to include the additional domains?

                            My understanding is that you have to create separate configs i.e your former suggestion. After all, there is no way of knowing domain2's autoconfig is in domain1.

                            1 Reply Last reply Reply Quote 0
                            • girish
                              girish Staff @robi last edited by

                              @robi said in email: autoconfig for autoconfiguration (example: via thunderbird):

                              This looks like it should simply be a checkbox in the UI, and Cloudron manages the ~yellowtent/boxdata/well-known/<domains> hierarchy.

                              Yes, correct. Except I broke this because I completely forgot about autoconfig well known support and only implemented mastodon and matrix 😕 Will get it fixed for 6.1.2.

                              1 Reply Last reply Reply Quote 2
                              • girish
                                girish Staff last edited by

                                @hakunamatata I have automated the mail autoconfig for all domains. It's part of 6.1.2. Should be out next week.

                                https://git.cloudron.io/cloudron/box/-/commit/ef68cb70c07f2abd524879aef70930b572f48917

                                jdaviescoates 1 Reply Last reply Reply Quote 11
                                • jdaviescoates
                                  jdaviescoates @girish last edited by

                                  @girish great stuff, thanks! 🙂

                                  I use Cloudron with Gandi & Hetzner

                                  1 Reply Last reply Reply Quote 0
                                  • H
                                    hakunamatata last edited by

                                    Super! Thanks everyone!

                                    1 Reply Last reply Reply Quote 0
                                    • H
                                      hakunamatata last edited by

                                      @girish my server updated to 6.1.2 last night and the autoconfig doesn't seem to be working. /home/yellowtent/boxdata/well-known/ is empty.

                                      girish 1 Reply Last reply Reply Quote 0
                                      • girish
                                        girish Staff @hakunamatata last edited by

                                        @hakunamatata yes, it's migrated to the database now. The email auto configuration is also automatic. You can find settings in domains -> advanced

                                        H 1 Reply Last reply Reply Quote 0
                                        • H
                                          hakunamatata @girish last edited by

                                          @girish I have an app installed on the bare domain as per the docs, however autoconfig is still not working on my end.

                                          Is there supposed to be a setting that I need to enable in domains > advanced ? Because I don't see anything related to this in the settings.

                                          girish 1 Reply Last reply Reply Quote 0
                                          • girish
                                            girish Staff @hakunamatata last edited by

                                            @hakunamatata Can you try this curl -v https://domain.com/.well-known/autoconfig/mail/config-v1.1.xml. If that returns a 404, can you go the bare domain app's Location view and click save (no need to make any changes) and then run the curl again?

                                            H 1 Reply Last reply Reply Quote 0
                                            • H
                                              hakunamatata @girish last edited by

                                              @girish said in email: autoconfig for autoconfiguration (example: via thunderbird):

                                              curl -v https://domain.com/.well-known/autoconfig/mail/config-v1.1.xml

                                              That seems to have done the trick. Thanks!

                                              girish 1 Reply Last reply Reply Quote 1
                                              • girish
                                                girish Staff @hakunamatata last edited by

                                                @hakunamatata Ah, I had put that "note" in https://docs.cloudron.io/domains/#matrix-server-location but forgot to put the same note for email configuration. Will do so, thanks.

                                                1 Reply Last reply Reply Quote 2
                                                • First post
                                                  Last post
                                                Powered by NodeBB