Code Monkey home page Code Monkey logo

autodiscover's Introduction

php-autodiscover

Generates a valid autodiscover.xml for mail clients.

Note: I've written this years ago. The PHP code isn't exactly up to standards anymore; while everything still works, I'm soon™ going to bring the project up to date and publish it as a composer package.

Usage

When mail clients are setup the first time, they'll try to connect to the subdomain autodiscover. of the respective mail domain to recieve their self-configuration information as an XML file. At a basic level, this includes things like mail server adresses for imap/pop and smtp servers, ports, SSL usage etc. Much more is possible though.
This script generates a valid autodiscover.xml file upon request, but inserts server information based on the email address. For example, if you own several vhosts, say, example.com, example.org, foo.com and bar.com. They all have subdomains for imap and smtp, like imap.example.com and smtp.example.com.
When setting up email accounts, it would be nice if the basic stuff would be automatically inserted - the mail servers, their ports, etc. That is exactly what this project does.

Setup

Put the autodiscover-folder into your webroot. Set up a new subdomain (via Hosting control panel or as a vhost using your own webserver) for autodiscover.example.com.

Configuration

The least information neeeded to autoconfigure email clients is the mail service domains and ports: Inside of autodiscover.php you will find this code:

    // pop settings
    $popServer = 'pop.' . $domain; // pop.example.com
    $popPort = 110;
    $smtpSSL = false;
    
    // imap settings
    $imapServer = 'imap.' . $domain; // imap.example.com
    $imapPort = 993;
    $imapSSL = true;
    
    // smtp settings
    $smtpServer = 'smtp.' . $domain; // smtp.example.com
    $smtpPort = 587;
    $smtpSSL = true;

The variable $domain is populated with the domain from the request.

Debugging

If the client throws an error or is unable to retrieve the config, you can enable a debug log holding each individual http request by uncommenting line 20 in autodiscover.php.

Known problems

  • Outlook takes pretty long for servers without a valid SSL certificate, so make sure to get one
  • Apple Mail doesn't implement the autodiscover protocol correctly, if you depend on this client, you might need to fiddle with the response

autodiscover's People

Contributors

latinsud avatar mattv8 avatar radiergummi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

autodiscover's Issues

Rearrangement of https://github.com/Radiergummi/php-autodiscover

Hi, I was looking for solutions to mail autodiscovery when I found this repo.

I was thinking that the way the stuff is arranged could be more practical.
If the repo was called ""autodiscover" and the .htaccess and autodiscover.php
was in the toplevel, you could wget and unpack the tarball inside the web-root
without further work.

I cloned it and rearranged it in:
https://github.com/emagii/autodiscover
but if you do the same, I can delete this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.