web/ponderings/mailautoconf/index.html

259 lines
14 KiB
HTML
Raw Normal View History

2023-02-22 22:50:46 +01:00
<!DOCTYPE html>
2024-05-31 17:49:23 +02:00
<html lang="en">
2024-07-29 13:43:21 +02:00
<head>
<title>Mailautoconf | Paul&#x27;s Site of Stuff</title>
2024-05-31 17:49:23 +02:00
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<meta name="robots" content="noodp"/>
<link rel="stylesheet" href="https://paulwilde.uk/style.css">
<link rel="stylesheet" href="https://paulwilde.uk/color/orange.css">
<link rel="stylesheet" href="https://paulwilde.uk/color/background_blue.css">
2024-07-29 13:43:21 +02:00
<link rel="stylesheet" href="https://paulwilde.uk/font-hack-subset.css">
2024-05-31 17:49:23 +02:00
<meta name="description" content="a simple, configurable autodiscover/autoconfig service for distributed and self-hosted services.">
<meta property="og:description" content="a simple, configurable autodiscover/autoconfig service for distributed and self-hosted services.">
<meta property="og:title" content="Mailautoconf | Paul's Site of Stuff">
<meta property="og:type" content="article">
<meta property="og:url" content="https://paulwilde.uk/ponderings/mailautoconf/">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:description" content="a simple, configurable autodiscover/autoconfig service for distributed and self-hosted services.">
<meta name="twitter:title" content="Mailautoconf | Paul's Site of Stuff">
<meta property="twitter:domain" content="paulwilde.uk">
<meta property="twitter:url" content="https://paulwilde.uk/ponderings/mailautoconf/">
2024-07-29 13:43:21 +02:00
<link rel="shortcut icon" type="image/png" href="/favicon.png">
</head>
<body class="">
<div class="container">
2024-05-31 17:49:23 +02:00
2024-07-29 13:43:21 +02:00
<header class="header">
<div class="header__inner">
<div class="header__logo">
2024-05-31 17:49:23 +02:00
2024-07-29 13:43:21 +02:00
<a href="https://paulwilde.uk" style="text-decoration: none;">
<div class="logo">
Hello, I&#x27;m Paul
</div>
</a>
2024-05-31 17:49:23 +02:00
</div>
2024-07-29 13:43:21 +02:00
</div>
2024-05-31 17:49:23 +02:00
2024-07-29 13:43:21 +02:00
<nav class="menu">
2024-05-31 17:49:23 +02:00
<ul class="menu__inner">
<li><a href="/">home</a></li>
<li><a href="/aboutme">about me</a></li>
<li><a href="/ponderings">ponderings</a></li>
2024-07-29 13:43:21 +02:00
<li><a href="/iuse">i use …</a></li>
2023-02-22 22:50:46 +01:00
2024-05-31 17:49:23 +02:00
<li><a href="/tags">tags</a></li>
2024-07-29 13:43:21 +02:00
<li><a href="/feed.xml">rss</a></li>
2024-05-31 17:49:23 +02:00
</ul>
</nav>
2024-07-29 13:43:21 +02:00
</header>
2024-05-31 17:49:23 +02:00
<div class="post">
<h1 class="post-title"><a href="https://paulwilde.uk/ponderings/mailautoconf/">Mailautoconf</a></h1>
<div class="post-meta-inline">
<span class="post-date">
2021-08-17
</span>
</div>
<span class="post-tags-inline">
:: tags:&nbsp;
2024-07-29 13:43:21 +02:00
<a class="post-tag" href="https://paulwilde.uk/tags/development/">#development</a>&nbsp;
<a class="post-tag" href="https://paulwilde.uk/tags/email/">#email</a></span>
<div class="sourcecode">
<a href="https:&#x2F;&#x2F;codeberg.org&#x2F;pswilde&#x2F;mailautoconf" target="_blank">source code</a>
</div>
2024-05-31 17:49:23 +02:00
<div class="post-content">
<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>
2023-02-22 22:50:46 +01:00
<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>
2024-05-31 17:49:23 +02:00
<span id="continue-reading"></span><h3 id="what-does-mailautoconf-do">What does MailAutoConf do?</h3>
2023-02-22 22:50:46 +01:00
<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>
2024-07-29 13:43:21 +02:00
<p>MailAutoConf will handle all the URLs it's able to deal with, i.e. <code>/mail/config-v1.1.xml</code>, <code>/Autodiscover/Autodiscover.xml</code> automatically.</p>
2023-02-22 22:50:46 +01:00
<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
2024-07-29 13:43:21 +02:00
directly to your MailAutoConf's instance which will work for Thunderbird and
2023-02-22 22:50:46 +01:00
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"/>
2024-07-29 13:43:21 +02:00
Add more code commenting, it's pretty terrible right now.</li>
2023-02-22 22:50:46 +01:00
<li><input disabled="" type="checkbox"/>
2024-07-29 13:43:21 +02:00
Refactor the autoconfig and autodiscover XML files, they've been copied and bodged together and could look so much better.</li>
2023-02-22 22:50:46 +01:00
<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"/>
2024-07-29 13:43:21 +02:00
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 - wouldn't that be nice?</li>
2023-02-22 22:50:46 +01:00
<li><input disabled="" type="checkbox"/>
2024-07-29 13:43:21 +02:00
Probably loads of stuff I haven't thought of yet.</li>
2023-02-22 22:50:46 +01:00
</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 />
2024-07-29 13:43:21 +02:00
I'm working on this ultimately for my own use for my own small business. I'm hoping once it's good enough I could deploy the set up to my businesses customers and ultimately get them away from a Microsoft Exchange based environment. There's a long way to go for that right now though.</p>
2023-02-22 22:50:46 +01:00
<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>
2024-05-31 17:49:23 +02:00
</div>
2023-02-22 22:50:46 +01:00
2024-05-31 17:49:23 +02:00
<div class="pagination">
<div class="pagination__title">
<span class="pagination__title-h">Thanks for reading! Read other posts?</span>
<hr />
</div>
<div class="pagination__buttons">
<span class="button previous">
<a href="https://paulwilde.uk/ponderings/skeletor/">
<span class="button__icon"></span>&nbsp;
<span class="button__text">St Skeletor&#x27;s Day</span>
</a>
</span>
<span class="button next">
2024-07-29 13:43:21 +02:00
<a href="https://paulwilde.uk/ponderings/toolsiuse/">
<span class="button__text">I Use …</span>&nbsp;
2024-05-31 17:49:23 +02:00
<span class="button__icon"></span>
</a>
</span>
</div>
</div>
</div>
2024-05-31 18:04:49 +02:00
2024-07-29 13:43:21 +02:00
<footer class="footer">
<div class="footer__inner">
<a href="https:&#x2F;&#x2F;notnull.space&#x2F;@paul" rel="me">fediverse (gts)</a>
<a href="https:&#x2F;&#x2F;snac.notnull.space&#x2F;paul" rel="me">fediverse (snac)</a>
<a href="https:&#x2F;&#x2F;codeberg.org&#x2F;pswilde" rel="me">codeberg</a>
<a href="https:&#x2F;&#x2F;keyoxide.org&#x2F;85633E30514CC1932E4268460ED12CF710BC42CA" rel="me">keyoxide</a>
</div>
<div class="footer__inner">
<div class="copyright">
<span>©
2024
Paul Wilde</span>
<span class="copyright-theme">
<span class="copyright-theme-sep">:: </span>
Theme: <a href="https://github.com/pawroman/zola-theme-terminimal/">Terminimal</a>
</span>
</div>
</div>
</footer>
2024-05-31 18:04:49 +02:00
</div>
2024-07-29 13:43:21 +02:00
</body>
2023-02-22 22:50:46 +01:00
</html>