web/dev/mailautoconf/index.html

213 lines
12 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en-gb">
<head>
<link rel="shortcut icon" type="image/jpg" href='&#x2F;images&#x2F;favicon.png'/>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="My site of stuff" />
<meta property="og:title" content="Paul Wilde :: Paul Wilde" />
<meta property="og:image" content='&#x2F;images&#x2F;favicon.png' />
<meta property="og:description" content="My site of stuff" />
<link rel="stylesheet" href="/css/gemini.css"/>
<link rel="stylesheet" href="/css/psw.css"/>
<title>Mailautoconf :: My site of stuff :: Paul Wilde</title>
</head>
<body class="page">
<a id="top"></a>
<header>
<h1>Paul Wilde :: My site of stuff &nbsp; <a href="#navigation" title="Navigation">&#128506;</a> <a href="#contact" title="Contact">&#128490;</a></h1>
</header>
<main class="main mailautoconf">
<h2>Mailautoconf</h2>
<h3 id="a-simple-configurable-autodiscover-autoconfig-service-for-distributed-and-self-hosted-services">A simple, configurable autodiscover/autoconfig service for distributed and self-hosted services.</h3>
<p>Codeberg = <a href="https://codeberg.org/pswilde/mailautoconf">codeberg link</a></p>
<h3 id="what-is-mailautoconf">What is MailAutoConf?</h3>
<p>MailAutoConf is autodiscover/autoconfig web server for self-hosted mail services
which do not have their own autodiscover service.</p>
<h3 id="what-does-mailautoconf-do">What does MailAutoConf do?</h3>
<p>MailAutoConf is currently in <em>very</em> early stages, but it does generate valid
autoconfig XML files (<code>/mail/config-v1.1.xml</code>) compatible with many mail clients
i.e. <code>Thunderbird</code>, <code>Evolution</code>, etc.<br />
Theoretically, anything that can read the standard autoconfig XML file -
<code>https://wiki.mozilla.org/Thunderbird:Autoconfiguration:ConfigFileFormat</code>, should
be able to auto-configure using this service.</p>
<h3 id="installation">Installation</h3>
<p>MailAutoConf runs its own webserver on port <code>8010</code>.
You will need to supply a volume for the configuration file and port forwarding.</p>
<pre data-lang="sh" style="background-color:#212121;color:#eeffff;" class="language-sh "><code class="language-sh" data-lang="sh"><span style="color:#82aaff;">podman run</span><span style="color:#89ddff;"> -</span><span style="color:#f78c6c;">dt </span><span style="color:#89ddff;">\
</span><span style="color:#89ddff;"> --</span><span style="color:#f78c6c;">name</span><span style="color:#82aaff;"> mailautoconf </span><span style="color:#89ddff;">\
</span><span style="color:#89ddff;"> -</span><span style="color:#f78c6c;">v</span><span style="color:#82aaff;"> ./config:/mailautoconf/config </span><span style="color:#89ddff;">\
</span><span style="color:#89ddff;"> -</span><span style="color:#f78c6c;">p</span><span style="color:#82aaff;"> 8010:8010 </span><span style="color:#89ddff;">\
</span><span style="color:#82aaff;"> pswilde/mailautoconf
</span></code></pre>
<p>You will need a reverse proxy server to publish to the outside world and handle SSL encryption.<br />
For example, in nginx:</p>
<pre data-lang="conf" style="background-color:#212121;color:#eeffff;" class="language-conf "><code class="language-conf" data-lang="conf"><span style="font-style:italic;color:#c792ea;">server </span><span>{
</span><span> </span><span style="color:#f78c6c;">listen 443</span><span> ssl;
</span><span> </span><span style="color:#f78c6c;">server_name </span><span>autoconfig</span><span style="color:#89ddff;">.</span><span>example</span><span style="color:#89ddff;">.</span><span>com;
</span><span> </span><span style="color:#f78c6c;">ssl_certificate </span><span style="color:#89ddff;">/</span><span>path</span><span style="color:#89ddff;">/</span><span>to</span><span style="color:#89ddff;">/</span><span>certificate</span><span style="color:#89ddff;">.</span><span>file;
</span><span> </span><span style="color:#f78c6c;">ssl_certificate_key </span><span style="color:#89ddff;">/</span><span>path</span><span style="color:#89ddff;">/</span><span>to</span><span style="color:#89ddff;">/</span><span>certificate</span><span style="color:#89ddff;">.</span><span>key
</span><span style="color:#c792ea;"> location </span><span style="color:#89ddff;">/</span><span> {
</span><span> </span><span style="color:#f78c6c;">proxy_set_header X</span><span style="color:#89ddff;">-</span><span>Forwarded</span><span style="color:#89ddff;">-</span><span>Host $host</span><span style="color:#89ddff;">:</span><span>$server_port;
</span><span> </span><span style="color:#f78c6c;">proxy_set_header X</span><span style="color:#89ddff;">-</span><span>Forwarded</span><span style="color:#89ddff;">-</span><span>Server $host;
</span><span> </span><span style="color:#f78c6c;">proxy_set_header X</span><span style="color:#89ddff;">-</span><span>Forwarded</span><span style="color:#89ddff;">-</span><span>For $proxy_add_x_forwarded_for;
</span><span> </span><span style="color:#f78c6c;">proxy_pass </span><span>http://localhost:8010</span><span style="color:#89ddff;">/</span><span>;
</span><span> </span><span style="color:#f78c6c;">proxy_redirect </span><span>http://localhsot:8010</span><span style="color:#89ddff;">/ /</span><span>;
</span><span> </span><span style="color:#f78c6c;">proxy_read_timeout 60s</span><span>;
</span><span> }
</span><span>}
</span></code></pre>
<p>First run will create <code>sample.yaml</code> files in the config directory. Copy these to <code>config.yaml</code> and <code>services.yaml</code> and configure them to your needs.</p>
<p>MailAutoConf will handle all the URLs its able to deal with, i.e. <code>/mail/config-v1.1.xml</code>, <code>/Autodiscover/Autodiscover.xml</code> automatically.</p>
<h3 id="dns-config">DNS config</h3>
<p>You will need to configure DNS records for your domain.<br />
I would recommend setting up an A record for <code>autoconfig.your.domain</code> to point
directly to your MailAutoConfs instance which will work for Thunderbird and
Evolution clients.
Then, if Outlook Autodiscover is required (currently not implemented), configure
a <code>SRV</code> record to redirect to the <code>autoconfig.your.domain</code> <code>A</code> record. i.e.</p>
<pre style="background-color:#212121;color:#eeffff;"><code><span>Type TTL P M Port Target
</span><span>SRV _autodiscover._tcp.your.domain 3600 10 10 443 autoconfig.your.domain
</span></code></pre>
<h3 id="compatibility">Compatibility</h3>
<p>MailAutoConf has been tested and confirmed working with the following software packages</p>
<ul>
<li><input disabled="" type="checkbox" checked=""/>
Thunderbird (v78 and probably earlier versions too)</li>
<li><input disabled="" type="checkbox" checked=""/>
Evolution Mail (v3.40.3 and probably earlier versions too)</li>
<li><input disabled="" type="checkbox" checked=""/>
Nextcloud Mail app</li>
<li><input disabled="" type="checkbox"/>
Other Mail Clients are likely supported if they support /mail/config-v1.1.xml</li>
</ul>
<h3 id="future-plans">Future plans</h3>
<p>MailAutoConf is currently in <em>very</em> early stages, with a <em>very</em> limited set of features.
My hope for MailAutoConf is to run as an autoconfig service which provides Calendar and AddressBook locations as well.
Calendar and AddressBook is in the autoconfig XML documentation, but currently not implemented. MailAutoConf can generate the correct information for Calendar and AddressBook into the autoconfig XML file, though no clients currently use it.</p>
<h3 id="todo">TODO:</h3>
<ul>
<li><input disabled="" type="checkbox" checked=""/>
/mail/config-v1.1.xml file for Thunderbird and Evolution mail clients.</li>
<li><input disabled="" type="checkbox"/>
Add more code commenting, its pretty terrible right now.</li>
<li><input disabled="" type="checkbox"/>
Refactor the autoconfig and autodiscover XML files, theyve been copied and bodged together and could look so much better.</li>
<li><input disabled="" type="checkbox"/>
Autodiscover.xml for Outlook clients - currently does generate, but untested.</li>
<li><input disabled="" type="checkbox"/>
Autodiscover.json for more modern Outlook clients - this is currently undocumented. I have implemented some features of it but it is currently not working.</li>
<li><input disabled="" type="checkbox"/>
Calendars and Address Book - does generate into mail/config-v1.1.xml, but no actual clients support it yet.</li>
<li><input disabled="" type="checkbox"/>
Additional, custom services. For example, Nextcloud - instead of having to type in your Nextcloud instance URL, you can just enter your email address associated with you Nextcloud account and it looks up the URL from autoconfig - wouldnt that be nice?</li>
<li><input disabled="" type="checkbox"/>
Probably loads of stuff I havent thought of yet.</li>
</ul>
<h3 id="when-will-it-be-ready-for-production">When will it be ready for production?</h3>
<p>Well, not yet. Though it does sort of work already.<br />
Im working on this ultimately for my own use for my own small business. Im hoping once its good enough I could deploy the set up to my businesses customers and ultimately get them away from a Microsoft Exchange based environment. Theres a long way to go for that right now though.</p>
<p>If you feel you may be able to help, or ideas on features and their implementation, notice any bugs, or just want to say hi. Please do so and submit a pull request if required.</p>
<p>Thanks for reading!</p>
<section>
<hr />
<sub>
<sub>Published : Tue, 17 August 2021 at 10:49am +0100<br/>
</sub>
</section>
</main>
<footer>
<a href="#top">Top</a>
<h2>Navigation</h2>
<a id="navigation"></a>
<ul>
<li>
<a href="https:&#x2F;&#x2F;paulwilde.uk&#x2F;">Home</a>
</li>
<li>
<a href="https:&#x2F;&#x2F;paulwilde.uk&#x2F;aboutme&#x2F;">About Me</a>
</li>
<li>
<a href="https:&#x2F;&#x2F;paulwilde.uk&#x2F;thanks&#x2F;">Thanks</a>
</li>
<li>
<a href="https:&#x2F;&#x2F;paulwilde.uk&#x2F;dev&#x2F;">Development</a>
</li>
<li>
<a href="https:&#x2F;&#x2F;paulwilde.uk&#x2F;tech&#x2F;">Tech Stuff</a>
</li>
<li>
<a href="https:&#x2F;&#x2F;paulwilde.uk&#x2F;websites&#x2F;">Websites</a>
</li>
<li>
<a href="https:&#x2F;&#x2F;paulwilde.uk&#x2F;recipes&#x2F;">Recipes</a>
</li>
<li>
<a href="https:&#x2F;&#x2F;paulwilde.uk&#x2F;poems&#x2F;">Poems</a>
</li>
<li>
<a href="https://wilde-it.co.uk" target="_blank">My Business</a>
</li>
</ul>
<h2>Contact</h2>
<a id="contact"></a>
<ul>
<li>
<a href="https://codeberg.org/pswilde" title="My main Git Repository">My Codeberg Repo</a>
</li>
<li>
<a rel="me" href="https://notnull.click/users/paul" title="Find me on the Fediverse">Fediverse</a>
</li>
<li>
<a href="https://matrix.to/#/@psw:matrix.wilde.cloud" title="Send me a message on Matrix">Matrix</a>
</li>
</ul>
</footer>
<script async defer data-domain="paulwilde.uk" src="https://plausible.wilde.cloud/js/plausible.js"></script>
</body>
</html>