Skip to content

Commit

Permalink
Merge pull request #6 from Monogramm/develop
Browse files Browse the repository at this point in the history
🔖 Release 1.3.0
  • Loading branch information
madmath03 authored Feb 26, 2020
2 parents 0942327 + cf13121 commit 5d22abf
Show file tree
Hide file tree
Showing 7 changed files with 163 additions and 35 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019 Monogramm
Copyright (c) 2020 Monogramm

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# autodiscover-email-settings
# ![Autodiscover](icon.svg) Autodiscover Email Settings

[![Build Status](https://travis-ci.org/Monogramm/autodiscover-email-settings.svg)](https://travis-ci.org/Monogramm/autodiscover-email-settings)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/f471992f0aa348b791c9ed17ccea344d)](https://www.codacy.com/gh/Monogramm/autodiscover-email-settings?utm_source=github.com&utm_medium=referral&utm_content=Monogramm/autodiscover-email-settings&utm_campaign=Badge_Grade)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/f471992f0aa348b791c9ed17ccea344d)](https://www.codacy.com/gh/Monogramm/autodiscover-email-settings?utm_source=github.com&utm_medium=referral&utm_content=Monogramm/autodiscover-email-settings&utm_campaign=Badge_Grade)
[![Docker Pulls](https://img.shields.io/docker/pulls/monogramm/autodiscover-email-settings.svg)](https://hub.docker.com/r/monogramm/autodiscover-email-settings/)
[![](https://images.microbadger.com/badges/version/monogramm/autodiscover-email-settings.svg)](https://microbadger.com/images/monogramm/autodiscover-email-settings)
[![Docker layers](https://images.microbadger.com/badges/image/monogramm/autodiscover-email-settings.svg)](https://microbadger.com/images/monogramm/autodiscover-email-settings)
Expand All @@ -12,7 +12,7 @@ It provides IMAP/SMTP/LDAP Autodiscover capabilities on Microsoft Outlook/Apple

**A simple support page is also available at the root of the autodiscover domain.**

### DNS settings
## DNS settings

autoconfig IN A {{$AUTODISCOVER_IP}}
autodiscover IN A {{$AUTODISCOVER_IP}}
Expand All @@ -39,12 +39,12 @@ Replace above variables with data according to this table

* * *

### Usage
## Usage

[traefik](https://github.com/containous/traefik) can proxy your containers on docker, on docker swarm, and on a wide range of orchestrators.
You can also achieve this with another proxy like [Nginx](https://www.nginx.com/) for instance.

#### docker
### docker

```yaml
version: '2'
Expand Down Expand Up @@ -79,7 +79,7 @@ services:
- "traefik.frontend.rule=Host:autoconfig.example.com,autodiscover.example.com"
```
#### docker swarm
### docker swarm
```yaml
version: '3'
Expand Down Expand Up @@ -116,19 +116,19 @@ services:
- "traefik.frontend.rule=Host:autoconfig.example.com,autodiscover.example.com"
```
### Credits
## Credits
Inspired from <https://github.com/sylvaindumont/autodiscover.xml>, but without the few restrictions mentioned in the original project notes and with a simple support page to allow manual setup and iOS profile download.
The original project was inspired from <https://github.com/johansmitsnl/docker-email-autodiscover>, but with <https://github.com/Tiliq/autodiscover.xml> instead of <https://github.com/gronke/email-autodiscover> to allow a much lighter ([![](https://images.microbadger.com/badges/image/weboaks/autodiscover-email-settings.svg)](https://microbadger.com/images/weboaks/autodiscover-email-settings)) image based of node on alpine instead of apache on debian ([![](https://images.microbadger.com/badges/image/jsmitsnl/docker-email-autodiscover.svg)](https://microbadger.com/images/jsmitsnl/docker-email-autodiscover))
### Notes
## Notes
The above autoconfiguration methods assume the following:
- If username does not contain `@`, full email address will be generated based on domain settings

### Links
## Links

- Mozilla [Autoconfig configuration](https://developer.mozilla.org/en-US/docs/Mozilla/Thunderbird/Autoconfiguration/FileFormat/HowTo)

Expand All @@ -140,6 +140,6 @@ The above autoconfiguration methods assume the following:

- [Bootstrap](https://getbootstrap.com/), [jQuery](https://jquery.com/) and [Popper.js](https://popper.js.org/) used for default support page

### License
## License

This project is distributed under the [MIT License](LICENSE)
85 changes: 85 additions & 0 deletions icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict';
"use strict";

const path = require("path");
const app = require("koa")();
Expand Down Expand Up @@ -40,7 +40,7 @@ function *autodiscover() {
email = "";
username = "";
domain = settings.domain;
} else if ( ~email.indexOf("@") ) {
} else if ( ~email.content.indexOf("@") ) {
email = email.content;
username = email.split("@")[0];
domain = email.split("@")[1];
Expand Down Expand Up @@ -88,7 +88,7 @@ router.get("/email.mobileconfig", function *autoconfig() {

let username;
let domain;
if (~email.indexOf("@") ) {
if ( ~email.indexOf("@") ) {
username = email.split("@")[0];
domain = email.split("@")[1];
} else {
Expand Down Expand Up @@ -122,6 +122,10 @@ router.get("/", function *index() {
yield this.render("index.html");
});

router.get("/favicon.ico", function *icon() {
yield this.render("favicon.ico");
});

app.context.render = swig({
root: path.join(__dirname, "views"),
autoescape: true,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "autodiscover-email-settings",
"version": "1.2.2",
"version": "1.3.0",
"description": "Provides IMAP/SMTP/LDAP Autodiscover capabilities on Microsoft Outlook/Apple Mail, Autoconfig capabilities for Thunderbird, and Configuration Profiles for iOS/Apple Mail.",
"main": "index.js",
"scripts": {
Expand Down
Binary file added views/favicon.ico
Binary file not shown.
79 changes: 59 additions & 20 deletions views/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@

<title>{{info.name}}</title>

<link rel="shortcut icon" href="favicon.ico" />

<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css"
integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
crossorigin="anonymous">

<style>
:root {
Expand Down Expand Up @@ -335,27 +338,45 @@ <h3 id="manualconfig" class="h3 font-weight-normal">Manual configuration</h3>
<div class="col-md-6">
<h5 id="manualconfig-imap">Incoming server (IMAP)</h5>
<dl>
<dt>Hostname</dt>
<dt>Hostname <button type="button"
class="btn btn-outline-secondary btn-sm"
title="Copy IMAP hostname"
onclick="copy('manualconfig-imap-hostname')">Copy</button></dt>
<dd id="manualconfig-imap-hostname">{{imap.host}}</dd>

<dt>Port</dt>
<dt>Port <button type="button"
class="btn btn-outline-secondary btn-sm"
title="Copy IMAP hostname"
onclick="copy('manualconfig-imap-port')">Copy</button></dt>
<dd id="manualconfig-imap-port">{{imap.port}}</dd>

<dt>Encryption</dt>
<dt>Encryption <button type="button"
class="btn btn-outline-secondary btn-sm"
title="Copy IMAP hostname"
onclick="copy('manualconfig-imap-socket')">Copy</button></dt>
<dd id="manualconfig-imap-socket">{{imap.socket}}</dd>
</dl>
</div>

<div class="col-md-6">
<h5 id="manualconfig-smtp">Outgoing server (SMTP)</h5>
<dl>
<dt>Hostname</dt>
<dt>Hostname <button type="button"
class="btn btn-outline-secondary btn-sm"
title="Copy IMAP hostname"
onclick="copy('manualconfig-smtp-hostname')">Copy</button></dt>
<dd id="manualconfig-smtp-hostname">{{smtp.host}}</dd>

<dt>Port</dt>
<dt>Port <button type="button"
class="btn btn-outline-secondary btn-sm"
title="Copy IMAP hostname"
onclick="copy('manualconfig-smtp-port')">Copy</button></dt>
<dd id="manualconfig-smtp-port">{{smtp.port}}</dd>

<dt>Encryption</dt>
<dt>Encryption <button type="button"
class="btn btn-outline-secondary btn-sm"
title="Copy IMAP hostname"
onclick="copy('manualconfig-smtp-socket')">Copy</button></dt>
<dd id="manualconfig-smtp-socket">{{smtp.socket}}</dd>
</dl>
</div>
Expand All @@ -367,22 +388,40 @@ <h5 id="manualconfig-smtp">Outgoing server (SMTP)</h5>
<div class="col-md-12">
<h5 id="manualconfig-ldap">Contacts (LDAP)</h5>
<dl>
<dt>Hostname</dt>
<dt>Hostname <button type="button"
class="btn btn-outline-secondary btn-sm"
title="Copy IMAP hostname"
onclick="copy('manualconfig-ldap-hostname')">Copy</button></dt>
<dd id="manualconfig-ldap-hostname">{{ldap.host}}</dd>

<dt>Port</dt>
<dt>Port <button type="button"
class="btn btn-outline-secondary btn-sm"
title="Copy IMAP hostname"
onclick="copy('manualconfig-ldap-port')">Copy</button></dt>
<dd id="manualconfig-ldap-port">{{ldap.port}}</dd>

<dt>Encryption</dt>
<dt>Encryption <button type="button"
class="btn btn-outline-secondary btn-sm"
title="Copy IMAP hostname"
onclick="copy('manualconfig-ldap-socket')">Copy</button></dt>
<dd id="manualconfig-ldap-socket">{{ldap.socket}}</dd>

<dt>Base</dt>
<dt>Base <button type="button"
class="btn btn-outline-secondary btn-sm"
title="Copy IMAP hostname"
onclick="copy('manualconfig-ldap-base')">Copy</button></dt>
<dd id="manualconfig-ldap-base">{{ldap.base}}</dd>

<dt>Username (replace <code>your.username</code> with your actual username)</dt>
<dt>Username (replace <code>your.username</code> with your actual username) <button type="button"
class="btn btn-outline-secondary btn-sm"
title="Copy IMAP hostname"
onclick="copy('manualconfig-ldap-username')">Copy</button></dt>
<dd id="manualconfig-ldap-username">{{ldap.userfield}}=<code>your.username</code>,{{ldap.usersbase}}</dd>

<dt>Search Filter</dt>
<dt>Search Filter <button type="button"
class="btn btn-outline-secondary btn-sm"
title="Copy IMAP hostname"
onclick="copy('manualconfig-ldap-searchfilter')">Copy</button></dt>
<dd id="manualconfig-ldap-searchfilter">{{ldap.searchfilter}}</dd>
</dl>
</div>
Expand All @@ -400,14 +439,14 @@ <h5 id="manualconfig-ldap">Contacts (LDAP)</h5>
</footer>

<!-- Bootstrap core JavaScript ================================================== -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js"
integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js"
integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut"
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js"
integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo"
crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"
integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k"
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js"
integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6"
crossorigin="anonymous"></script>

<!-- Custom JavaScript ================================================== -->
Expand Down

0 comments on commit 5d22abf

Please sign in to comment.