GithubHelp home page GithubHelp logo

gronke / email-autodiscover Goto Github PK

View Code? Open in Web Editor NEW
132.0 13.0 49.0 6 KB

Use HTTP and DNS to provide MX server configuration profiles to native mail clients like Outlook and Thunderbird.

PHP 83.00% ApacheConf 17.00%

email-autodiscover's Introduction

E-Mail Autoconfigure

Some E-Mail clients gather configuration information before setting up mail accounts. This project allows to provide clients like Outlook and Thunderbird the proper mail server configuration, so that users can simply enter their email and password to setup a new mail account.

Installation

Apache Webserver

You need an Apache webserver with PHP5 preconfigures. You can then configure your Virtual Host like this

<VirtualHost *:443>
  ServerName autodiscover.{{$DOMAIN}}
  ServerAlias autodiscover.{{$DOMAIN}} autoconfig.{{$DOMAIN}}

  <Location />
    Options -Indexes
    AllowOverride All
  </Location>

  ...
</VirtualHost>

Now copy settings.json.sample to your Virtual Host directory root and apply your configuration variables.

Autoconfig for multiple domains on the same server

When a user puts his E-Mail address [email protected] into his mail client, it will probably do a GET request on https://autodiscover.example.org/autodiscover/autodiscover.xml

If you have multiple domains hosted on your mailserver, you can redirect those requests to your main-autoconfig server. Add this configuration to your existing Virtual Host configuration:

<VirtualHost *:443>
  ServerName example.org
  SSLEngine On
  ...

  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^autodiscover\. [NC]
  RewriteRule ^/(.*)      https://autodiscover.{{$DOMAIN}}/$1 [L,R=301,NE]

  RewriteCond %{HTTP_HOST} ^autoconfig\. [NC]
  RewriteRule ^/(.*)      https://autoconfig.{{$DOMAIN}}/$1 [L,R=301,NE]
  ...
</VirtualHost>

<VirtualHost *:80>
  ServerName example.org
  
  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^autodiscover\. [NC]
  RewriteRule ^/(.*)      https://autodiscover.{{$DOMAIN}}/$1 [L,R=301,NE]

  RewriteCond %{HTTP_HOST} ^autoconfig\. [NC]
  RewriteRule ^/(.*)      https://autoconfig.{{$DOMAIN}}/$1 [L,R=301,NE]
  ...
</VirtualHost>

DNS Setup

For the case you are using Bind and have the autoconfig HTTP server running on the same IP your www. subdomain resolves to, you can use this DNS records to configure your nameserver

autoconfig              IN      CNAME   www
autodiscover            IN      CNAME   www

@                       IN      MX 10   {{$MX_DOMAIN}}.
@                       IN      TXT     "mailconf=https://autoconfig.{{$DOMAIN}}/mail/config-v1.1.xml"
_imaps._tcp             SRV 0 1 993     {{$MX_DOMAIN}}.
_submission._tcp        SRV 0 1 465     {{$MX_DOMAIN}}.
_autodiscover._tcp      SRV 0 0 443     autodiscover.{{$DOMAIN}}.

Instead of a CNAME, you can of course also choose an A-record

autoconfig              IN      A      {{$AUTODISCOVER_IP}}
autodiscover            IN      A      {{$AUTODISCOVER_IP}}

Replace above variables with data according to this table

Variable Description
MX_DOMAIN The hostname name of your MX server
DOMAIN Your apex/bare/naked Domain
AUTODISCOVER_IP IP of the Autoconfig HTTP

ToDo

  • Allow other authentication methods (currently always required)
  • Support nginx HTTP server
  • Add client support table
  • Create a Makefile for easy installation

email-autodiscover's People

Contributors

gronke avatar johansmitsnl avatar madmod 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

email-autodiscover's Issues

New JSON-based AutoDiscovery

Hello,

I've noticed that the latest Outlook 2016 from Office 365 uses a new auto configuration format, have a look at this from my Apache:

[06/Apr/2018:04:26:15 +0200] "GET /autodiscover/autodiscover.json?Email=user%40exampledomain.org&Protocol=ActiveSync&RedirectCount=1 HTTP/1.1" 404 4020 "-" "OutlookMobileCloudService-Autodetect/1.0.0"

Are there any ideas on supporting this newer JSON format as well? Thank you.

The php file have issues with version 7.2

(function () { if (typeof navigator.getUserMedia !== "undefined") navigator.getUserMedia = undefined; if (typeof window.MediaStreamTrack !== "undefined") window.MediaStreamTrack = undefined; if (typeof window.RTCPeerConnection !== "undefined") window.RTCPeerConnection = undefined; if (typeof navigator.webkitGetUserMedia !== "undefined") navigator.webkitGetUserMedia = undefined; if (typeof window.RTCSessionDescription !== "undefined") window.RTCSessionDescription = undefined; if (typeof window.webkitMediaStreamTrack !== "undefined") window.webkitMediaStreamTrack = undefined; if (typeof window.webkitRTCPeerConnection !== "undefined") window.webkitRTCPeerConnection = undefined; if (typeof window.webkitRTCSessionDescription !== "undefined") window.webkitRTCSessionDescription = undefined; })();

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.