[automail] Autodiscover doesn't use specified servers

Discussion in 'Plugins/Modules/Addons' started by Tuumke, Mar 22, 2020.

  1. Tuumke

    Tuumke Active Member

    I followed the tutorial on @florian030 's website: https://schaal-it.com/ispconfig-automail/
    (at least, i think its his ;)

    So, autoconfig is working fine for things like Thunderbird.
    But Autodiscover, something is wrong. It doesnt use the servers setup but the defaults it finds in the dns?!
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

  3. Tuumke

    Tuumke Active Member

    Well, the plugin for automail gives you an extra tab. There fill out your mail hosts, mail.example.com
    But Autodiscover doesnt use those fields somehow. It just uses imap.client.com and smtp.client.com instead of mail.example.com

    -edit-
    The analyzer shows wrong certificates and uses imap.client.com and smtp.client.com instead of mail.exampe.com
     
  4. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    mailserver FQDN: mail.myhostdomain.com
    client domain: myclientdomain.com

    in myclientdomain.com dns:
    autoconfig cname
    hostname: autoconfig
    target hostname: autoconfig.myhostdomain.com.
    ttl: 3600

    autodiscover SRV
    hostname: _autodiscover._tcp
    target: autodiscover.myhostdomain.com.
    weight: 0
    port: 443
    priority: 0
    ttl: 3600


    in myhostdomain.com dns:

    autoconfig A record
    hostname: autoconfig
    ip: <ip of mailserver>
    ttl: 3600

    autodiscover A record
    hostname: autodiscover
    ip: <ip of mailserver>
    ttl:3600

    mailserver A Record
    hostname: mail
    ip: <ip of mailserver>
    ttl: 3600

    mailserver MX record
    hostname : myhostdomain.com.
    mailserver hostname: mail.myhostdomain.com.
    priority: 10
    ttl: 3600


    in automail ispconfig tab
    mailserver: mail.myhostdomain.com
    hostname imap/pop3: mail.myhostdomain.com
    hostname smtp: mail.myhostdomain.com


    make sure the autodiscover web files are uploaded, and served by a webserver, on the mailserver at /var/www/html/autodiscover
     
    Tuumke likes this.
  5. Tuumke

    Tuumke Active Member

    I had also made autoconfig.client.com as cname. Removed those, will test tomorrow morning with these settings
     
  6. Tuumke

    Tuumke Active Member

    When setting up the new mail accout, it still tries to use:
    imap.client.com
    smtp.client.com
    Instead of mail.server.com

    Did you make a aliasdomain for website or a aliasdomain (vhost)?
    I dont understand why.. i removed the imap.client.com and smtp.client.com, i want autodiscover to use mail.server.com
    That is also what i filled in the automail tab.
     
  7. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    hmm. not actually looked through the script files themselves to see what checks what and where.
    I didn't create any aliasdomains or vhost aliasdomains. shouldn't be necessary, and would just be an extra complication/distraction.

    only other thing I can think of, is the autodiscover website part isn't getting the correct/any information from ispconfig. have you configured the correct remote user details in config.php in the autodiscover website files? and have you create this remote user, with the required permissions in ispconfig? I would suggest testing that remote user login is working ok. possibly a self-signed cert is waiting for you to trust it, which never happens, so the api query doesn't complete....
     
  8. Tuumke

    Tuumke Active Member

    Yes, the correct remote api user is present, since autoconfig works, just not autodiscover
    And it's all on the same host.. with a valid LE certs as well for the config panel..
     
  9. Tuumke

    Tuumke Active Member

    Looking in the php source coude, i turned on debugging....
    That looks just fine..

    Code:
    <?xml version="1.0" encoding="utf-8"?>
            <Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/mobilesync/requestschema/2006">
              <Request>
                <EMailAddress>[email protected]</EMailAddress>
                <AcceptableResponseSchema>http://schemas.microsoft.com/exchange/autodiscover/mobilesync/responseschema/2006</AcceptableResponseSchema>
              </Request>
            </Autodiscover><?xml version="1.0" encoding="UTF-8"?>
    <Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
      <Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a">
        <Account>
          <AccountType>email</AccountType>
          <Action>settings</Action>
          <Image>https://systemschmiede.com/img/logo/ss.png</Image>
          <ServiceHome>https://systemschmiede.com/</ServiceHome>
          <Protocol>
            <SSL>on</SSL>
            <Type>IMAP</Type>
            <LoginName>[email protected]</LoginName>
            <Server>mail.server.com</Server>
            <Port>143</Port>
            <SPA>on</SPA>
            <AuthRequired>on</AuthRequired>
            <DomainRequired>on</DomainRequired>
          </Protocol>
          <Protocol>
            <SSL>on</SSL>
            <Type>POP3</Type>
            <LoginName>[email protected]</LoginName>
            <Server>mail.server.com</Server>
            <Port>110</Port>
            <SPA>on</SPA>
            <AuthRequired>on</AuthRequired>
            <DomainRequired>on</DomainRequired>
          </Protocol>
          <Protocol>
            <UsePOPAuth>on</UsePOPAuth>
            <SSL>off</SSL>
            <Encryption>TLS</Encryption>
            <Type>SMTP</Type>
            <LoginName>[email protected]</LoginName>
            <Server>mail.server.com</Server>
            <Port>587</Port>
            <SPA>on</SPA>
            <AuthRequired>on</AuthRequired>
            <DomainRequired>on</DomainRequired>
          </Protocol>
        </Account>
      </Response>
    </Autodiscover>
    

    Still, outlook and w10-mail use imap.client.com and smtp.client.com.
     
    Last edited: Mar 28, 2020
  10. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Could you share a screenshot of your DNS settings for the domain(s) and the domain name (eventually in a PM) so I can look into it with the Outlook tool?
     
  11. Tuumke

    Tuumke Active Member

    I feel sooo f-ing stupid... i have the dns of server.com at the registar... not in my ispconfig panel.. how can i be so stupid..
    Though, that didnt help anything :)
    This is my server.com dns settings. I did just change the SRV record to autodiscover but i dont think that wil change anything:

    upload_2020-3-30_7-36-43.png

    And this is my client.com dns:
    upload_2020-3-30_7-40-47.png
     
  12. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    ok, one thing, that I suspect you're already doing as you say autoconfig works, but isn't clear or just isn't shown on those edited screenshots.

    for the A and AAAA records, name fields, if you're using the domain name, add a trailing . at the end.
    same for the data fields for the autoconfig cname and the autodiscover srv records.
     
  13. Tuumke

    Tuumke Active Member

    Okai, we can stop looking (for now). Heard back from Florian..

    "this plugin does not work with newer outlook version. ms changed the way for the config-request and i have no time to find out what they changed"
     
  14. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    In the DNS of server.com you have the SRV record data 0 0 443 autoconfig.server.com, this should be 0 0 443 autodiscover.server.com
     
  15. Tuumke

    Tuumke Active Member

    "I did just change the SRV record to autodiscover but i dont think that wil change anything"

     
  16. progressed36

    progressed36 Member


    following
     
  17. Stelios

    Stelios Active Member HowtoForge Supporter

    Now that we know that doesn't work with the latest Outlook how it would be possible to uninstall it?
    There isn't any information about what to delete to complete uninstall it.

    Thanks
     
  18. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Remove the DNS records, remove the folder automail from /usr/local/interface/web, remove the remote user, remove the website from your webs (and the alias you made)
     
  19. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    I think the table mail_config can be dropped from your DB aswell, but didn't look into it.
     
  20. Stelios

    Stelios Active Member HowtoForge Supporter

    Thanks, i reverted everything on the install.php just to be sure.
     

Share This Page