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


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Discuss
  3. Autoconfig for mail when website not hosted on Cloudron?

Autoconfig for mail when website not hosted on Cloudron?

Scheduled Pinned Locked Moved Discuss
emailautoconfig
8 Posts 5 Posters 1.4k Views 6 Watching
  • 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.
  • d19dotcaD Offline
    d19dotcaD Offline
    d19dotca
    wrote on last edited by girish
    #1

    I see that Cloudron since 6.1 has supported autoconfig for mail clients (mostly Thunderbird and any mail clients that support that same protocol). However, it looks like Cloudron requires an app located at the bare/naked domain so that the Nginx can generate the autoconfig setup.

    That requirement leads to a problem scenario for Cloudron admins who have clients who have websites hosted elsewhere and only using us for email hosting. In my case I recently onboarded a client who only wants me to handle email as their web designer already hosts their website (but doesn't do email). This means I cannot offer up an app located at their bare domain since it'd be used already to point to their external web server.

    What is the recommendation in such a scenario, if we have one?

    --
    Dustin Dauncey
    www.d19.ca

    1 Reply Last reply
    3
    • d19dotcaD Offline
      d19dotcaD Offline
      d19dotca
      wrote on last edited by d19dotca
      #2

      I came up with what I think is a workaround. It means I'm doing it manually instead of Cloudron, but that's not a big deal as these values don't really change.

      I created a DNS record for them in their domain for autoconfig.<clientDomain>.<tld> which is a CNAME to autoconfig.<myDomain>.<tld>, which resolves to a Surfer app on their domain and mine for autoconfig. I then created a mail folder in the Surfer app, and then the config-v1.1.xml file for Thunderbird which then contains the following data (some of it is substituted out of course):

      <?xml version="1.0" encoding="UTF-8"?>
      
      <clientConfig version="1.1">
        <emailProvider id="myMailServerDomainName">
      
          <domain>example.com</domain>
          <domain>example2.com</domain>
      
          <displayName>DisplayName</displayName>
          <displayShortName>ShortName</displayShortName>
      
          <incomingServer type="imap">
            <hostname>mail.myMailServerDomainName.TLD</hostname>
            <port>993</port>
            <socketType>SSL</socketType>
            <authentication>plain</authentication>
            <username>%EMAILADDRESS%</username>
          </incomingServer>
      
          <outgoingServer type="smtp">
            <hostname>mail.myMailServerDomainName.TLD</hostname>
            <port>587</port>
            <socketType>STARTTLS</socketType>
            <authentication>plain</authentication>
            <username>%EMAILADDRESS%</username>
          </outgoingServer>
      
        </emailProvider>
      </clientConfig>
      

      I ran some tests in Thunderbird and it seemed to work for each domain I added to the file.

      Still trying to test out for Outlook and Apple Mail, but that's a project for another day. 😄

      --
      Dustin Dauncey
      www.d19.ca

      robiR 1 Reply Last reply
      3
      • girishG Offline
        girishG Offline
        girish
        Staff
        wrote on last edited by
        #3

        Thanks, I have put a note in https://docs.cloudron.io/email/#autoconfigxml

        1 Reply Last reply
        2
        • andreasduerenA Offline
          andreasduerenA Offline
          andreasdueren
          wrote on last edited by
          #4

          On my quest to get auto discovery working with apple devices I stumbled across this project: https://github.com/Monogramm/autodiscover-email-settings @girish Maybe worth looking into packaging?

          1 Reply Last reply
          3
          • girishG Offline
            girishG Offline
            girish
            Staff
            wrote on last edited by
            #5

            @andreasdueren if you can figure out what Appe actually needs, we can put that in cloudron code itself

            necrevistonnezrN 1 Reply Last reply
            3
            • d19dotcaD d19dotca

              I came up with what I think is a workaround. It means I'm doing it manually instead of Cloudron, but that's not a big deal as these values don't really change.

              I created a DNS record for them in their domain for autoconfig.<clientDomain>.<tld> which is a CNAME to autoconfig.<myDomain>.<tld>, which resolves to a Surfer app on their domain and mine for autoconfig. I then created a mail folder in the Surfer app, and then the config-v1.1.xml file for Thunderbird which then contains the following data (some of it is substituted out of course):

              <?xml version="1.0" encoding="UTF-8"?>
              
              <clientConfig version="1.1">
                <emailProvider id="myMailServerDomainName">
              
                  <domain>example.com</domain>
                  <domain>example2.com</domain>
              
                  <displayName>DisplayName</displayName>
                  <displayShortName>ShortName</displayShortName>
              
                  <incomingServer type="imap">
                    <hostname>mail.myMailServerDomainName.TLD</hostname>
                    <port>993</port>
                    <socketType>SSL</socketType>
                    <authentication>plain</authentication>
                    <username>%EMAILADDRESS%</username>
                  </incomingServer>
              
                  <outgoingServer type="smtp">
                    <hostname>mail.myMailServerDomainName.TLD</hostname>
                    <port>587</port>
                    <socketType>STARTTLS</socketType>
                    <authentication>plain</authentication>
                    <username>%EMAILADDRESS%</username>
                  </outgoingServer>
              
                </emailProvider>
              </clientConfig>
              

              I ran some tests in Thunderbird and it seemed to work for each domain I added to the file.

              Still trying to test out for Outlook and Apple Mail, but that's a project for another day. 😄

              robiR Offline
              robiR Offline
              robi
              wrote on last edited by
              #6

              @d19dotca cool, so you use your domain to bootstrap their mail autoconfig.

              Nice to know it doesn't need to be at the client domain!

              Conscious tech

              1 Reply Last reply
              1
              • girishG girish

                @andreasdueren if you can figure out what Appe actually needs, we can put that in cloudron code itself

                necrevistonnezrN Offline
                necrevistonnezrN Offline
                necrevistonnezr
                wrote on last edited by
                #7

                @girish said in Autoconfig for mail when website not hosted on Cloudron?:

                @andreasdueren if you can figure out what Appe actually needs, we can put that in cloudron code itself

                I assume the relevant code is https://github.com/Monogramm/autodiscover-email-settings/blob/master/views/mobileconfig.xml

                1 Reply Last reply
                4
                • girishG Offline
                  girishG Offline
                  girish
                  Staff
                  wrote on last edited by
                  #8

                  Per https://github.com/Monogramm/autodiscover-email-settings/blob/66c144e923f245dc0b4e64421449afedcad64052/index.js#L89 this is served at /email.mobileconfig?email=username@domain.com . I am yet to find an official doc page that says this though.

                  However, ChatGPT thinks it is configs/email.mobileconfig served with content-type set to application/x-apple-aspen-config ...

                  1 Reply Last reply
                  4
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Bookmarks
                  • Search