INSTALL

Christian Roessner

Wrote the program. 

Edited by

Patrick Ben Koetter

Wrote the documentation. 

Table of Contents

1. automx Download
2. Software Requirements
3. Installing automx
3.1. Installing the program
3.2. Installing the test program
3.3. Installing automx-specific libraries
3.4. Installing the configuration file
3.5. Installing man Pages
4. DNS Configuration
5. Web Server Configuration
6. Testing And Debugging automx

Abstract

This document contains step by step instructions to install automx.

1. automx Download

If you haven't done so yet download automx from its website.

$ wget http://automx.org/download/latest.tar.gz

Unpack the tar archive and change into the newly created directory.

$ tar xzf latest.tar.gz
$ cd automx-VERSION

2. Software Requirements

automx is a Python application. You must install a few extra modules to handle frontend and backend communication as well to deal with XML data.

frontend

Install mod_wsgi for the Apache web server and the python-wsgi module.

backend (optional)

If you plan to use either LDAP or SQL as backends to retrieve configuration options from install ldap for LDAP and python-sqlalchemy for SQL. Further you also need to install the SQL backend driver that communicates with your database. For MySQL this might be mysqldb.

XML handling

Install python lxml or automx will not be able to handle the XML data it needs to deal with.

Once you've satisfied the requirements, you can start to install automx.

3. Installing automx

automx is a wsgi script depending on some automx-specific libraries. It reads its configuration from a single configuration file. The program, the libraries and the configuration file need to be installed at different locations.

3.1. Installing the program

Create a directory for the automx program and copy it to that location:

% mkdir -p /usr/local/lib/automx
% cp automx-VERSION/automx.wsgi /usr/local/lib/automx/

3.2. Installing the test program

Copy the automx-test program to a location that is in your $PATH:

% cp automx-VERSION/automx-test /usr/local/bin/automx-test

3.3. Installing automx-specific libraries

Python provides a directory with site specific packages, called site-packages. Copy the automx directory including all its files to site-packages:

% cp automx-VERSION/automx /usr/local/lib/python2.6/site-packages/
[Note]site-packages

The location of that directory depends on the Python version and the distribution you use.

3.4. Installing the configuration file

Place the sample automx.conf file into /etc.

% cp automx-VERSION/src/conf/automx.conf /etc/

Follow automx.conf(5) Adopt this configuration file to your needs. You may find detailed information in the man page automx.conf(5).

[Tip]Tip

Set debug=yes in the section automx while you setup, configure and test automx. It will help you detect problems more easily. This will log the request GET/POST and the response to the error.log file(s).

3.5. Installing man Pages

Try using the manpath command to find out where man pages are stored on your computer:

$ manpath 
/usr/local/man:/usr/local/share/man:/usr/share/man

Copy the man pages to that location.

% cp -a automx-VERSION/doc/man/ /usr/local/share/man

4. DNS Configuration

Mail clients seeking mail account autoconfiguration will either request an IP address for autoconfig.example.com (Mozilla schema) or autodiscover.example.com (Microsoft schema). Provide settings in your DNS that directs them to the server running the automx service:

autoconfig.example.com.       IN    A     192.168.2.1
autodiscover.example.com.     IN    A     192.168.2.1

5. Web Server Configuration

Finally configure the web server. It will accept configuration requests from mail clients, pass the information to automx and in turn will respond with account profiles once automx has figured out the details.

First enable the wsgi module. Follow your OS documentation to find out how it needs to be done.

automx is able to provision mail clients following the Mozilla autoconfig schema as well as mail clients following the Microsoft autodiscover schema. Both schemas have different requirements regarding hostname, port and level of security when a request is sent to the configuration server:

Microsoft

Mail clients following the Microsoft autodiscover schema require a https connection. The web server must identify itself as autodiscover.example.com on port 443 and it must use a valid server certificate that is trusted by the mail client requesting configuration.

Mozilla

Mail clients following the Mozilla autoconfig schema can use either a http or a https connection. The web server must identify itself as autoconfig.example.com on port 80 or 443. If it connects on 443 a valid server certificate that is trusted by the mail client requesting configuration has to be used.

Here is a simple example that configures an autoconfig and an autodiscover service - both use the same automx script:

<VirtualHost *:80>

  ServerName example.com
  ServerAlias autoconfig.example.com
  ServerAdmin webmaster@example.com

  <IfModule mod_wsgi.c>
    WSGIScriptAlias /mail/config-v1.1.xml /usr/local/lib/automx/automx.wsgi
    <Directory "/usr/local/lib/automx">
      Order allow,deny
      Allow from all
    </Directory>
  </IfModule>

</VirtualHost>

<VirtualHost *:443>

  ServerName example.com:443
  ServerAlias autoconfig.example.com:443
  ServerAdmin webmaster@example.com

  <IfModule mod_wsgi.c>
    WSGIScriptAlias /Autodiscover/Autodiscover.xml /usr/local/lib/automx/automx.wsgi
    WSGIScriptAlias /autodiscover/autodiscover.xml /usr/local/lib/automx/automx.wsgi
    <Directory "/usr/local/lib/automx">
      Order allow,deny
      Allow from all
    </Directory>
  </IfModule>

</VirtualHost>
[Note]ISPs

In an advanced environment with thousands of domains, you can redirect mail clients via DNS entries to your ISP automx provisioning server for Microsoft clients and a web server instance with a wild card ServerName autoconfig.* to serve the Mozilla schema.

autoconfig.example.com.       IN    A     192.168.2.1
autodiscover.example.com.     IN    A     192.168.2.1

automx comes with a little utility that helps testing proper operation. The next section explains how to use it.

6. Testing And Debugging automx

The automx-test utility sends configuration requests for Microsoft and Mozilla clients to the web server:

$ automx-test user@example.com 1

1

The domainpart in the address determines the list of hostnames that will be queried. In this example autoconfig.example.com and autodiscover.example.com will be contacted.

You should see the web server header and get XML results from the server.

If things go wrong, the error.log is your friend. It will indicate configuration issues, if python modules are missing, if your database can not be queried or anything else that might go wrong.

[Note]Note

If you split error logs by port, e.g. port 80 and 443, you need to check both. Autoconfig requests will mostly show up in the port 80 error.log, whereas autodiscover will only show up in your 443 error.log.