Skip to content

Commit

Permalink
Merge pull request #8 from Monogramm/develop
Browse files Browse the repository at this point in the history
🔖 Release 1.4.0
  • Loading branch information
madmath03 authored May 1, 2020
2 parents 3b46ea3 + 0099e91 commit 9a5c8b5
Show file tree
Hide file tree
Showing 15 changed files with 467 additions and 90 deletions.
51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: madmath03

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

Provide Docker commands or docker-compose file if possible.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Node (please complete the following information):**

- Node / NPM Version: (e.g. Node version 12.16.1)

**Docker (please complete the following information):**

- Docker / Docker-compose Version: (e.g. Docker version 18.03.0-ce, build 0520e24)
- Image (e.g. 7.0-apache)

**Desktop (please complete the following information):**

- OS: (e.g. iOS)
- Browser (e.g. chrome, safari)
- Version (e.g. 22)

**Smartphone (please complete the following information):**

- Device: (e.g. iPhone6)
- OS: (e.g. iOS8.1)
- Browser (e.g. stock browser, safari)
- Version (e.g. 22)

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: madmath03

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when (...)

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
29 changes: 29 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!--
Some key notes before you open a PR:
1. Select which branch should this PR be merged in? By default, you should always merge to the develop branch.
2. PR name follows [convention](http://karma-runner.github.io/4.0/dev/git-commit-msg.html)
3. All tests pass locally, UI and Unit tests
4. All business logic and validations must be on the server-side
5. Update necessary Documentation
6. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes
Also, if you're new here
- Contribution Guide => https://github.com/Monogramm/autodiscover-email-settings/blob/master/CONTRIBUTING.md
-->

> Please provide enough information so that others can review your pull request:
<!-- You can skip this if you're fixing a typo or updating existing documentation -->

> Explain the **details** for making this change. What existing problem does the pull request solve?
<!-- Example: When "Adding a function to do X", explain why it is necessary to have a way to do X. -->

> Screenshots/GIFs
<!-- Add images/recordings to better visualize the change: expected/current behviour -->
35 changes: 35 additions & 0 deletions .github/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome

# Comment to be posted to on first time issues
newIssueWelcomeComment: >
Thanks for opening your first issue here! Be sure to follow the issue template!
# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome

# Comment to be posted to on PRs from first time contributors in your repository
newPRWelcomeComment: >
Thanks for opening this pull request! Please check out our contributing guidelines.
# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge

# Comment to be posted to on pull requests merged by a first time user
firstPRMergeComment: >
:tada: Congrats on merging your first pull request! We here at behaviorbot are proud of you!
# It is recommend to include as many gifs and emojis as possible

# Configuration for request-info - https://github.com/behaviorbot/request-info

# *Required* Comment to reply with
requestInfoReplyComment: >
We would appreciate it if you could provide us with more info about this issue/pr!
# *OPTIONAL* default titles to check against for lack of descriptiveness
# MUST BE ALL LOWERCASE
requestInfoDefaultTitles:
- update readme.md
- updates


# *OPTIONAL* Label to be added to Issues and Pull Requests with insufficient information given
requestInfoLabelToAdd: needs-more-info
23 changes: 23 additions & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Configuration for probot-stale - https://github.com/probot/stale

# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale issue is closed
daysUntilClose: 30

# Issues with these labels will never be considered stale
exemptLabels:
- pinned
- security

# Label to use when marking an issue as stale
staleLabel: wontfix

# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
20 changes: 14 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
os: linux
dist: trusty
sudo: required

services: docker

language: bash
language: shell

branches:
only:
- master

before_script:
before_install:
- env | sort
- dir="."
- export home=$(pwd)
- export travis_dir="${home}"

script:
- cd "$dir"
install:
- echo "Changing to travis test directory ($travis_dir)"
- cd "$travis_dir"
# Test container build
- travis_retry docker-compose build

before_script:
- docker images

script:
- echo "Changing to travis test directory ($travis_dir)"
- cd "$travis_dir"
# Test container run
- travis_retry docker-compose up -d && sleep 20
- docker-compose ps
Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

This service is created to autodiscover your provider email settings.

It provides IMAP/SMTP/LDAP Autodiscover capabilities on Microsoft Outlook/Apple Mail, Autoconfig capabilities for Thunderbird, and Configuration Profiles for iOS/Apple Mail.
It provides IMAP/POP/SMTP/LDAP Autodiscover capabilities on Microsoft Outlook/Apple Mail, Autoconfig capabilities for Thunderbird, and Configuration Profiles for iOS/Apple Mail.

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

Expand All @@ -21,6 +21,7 @@ It provides IMAP/SMTP/LDAP Autodiscover capabilities on Microsoft Outlook/Apple
@ IN MX 10 {{$MX_DOMAIN}}.
@ IN TXT "mailconf=https://autoconfig.{{$DOMAIN}}/mail/config-v1.1.xml"
_imaps._tcp IN SRV 0 0 {{IMAP_PORT}} {{MX_DOMAIN}}.
_pop3s._tcp IN SRV 0 0 {{POP_PORT}} {{MX_DOMAIN}}.
_submission._tcp IN SRV 0 0 {{SMTP_PORT}} {{MX_DOMAIN}}.
_autodiscover._tcp IN SRV 0 0 443 autodiscover.{{$DOMAIN}}.
_ldap._tcp IN SRV 0 0 {{LDAP_PORT}} {{LDAP_HOST}}.
Expand All @@ -33,6 +34,7 @@ Replace above variables with data according to this table
| DOMAIN | Your apex/bare/naked Domain |
| AUTODISCOVER_IP | IP of the Autoconfig HTTP |
| IMAP_PORT | Port for your IMAP server |
| POP_PORT | Port for your POP server |
| SMTP_PORT | Port for your SMTP server |
| LDAP_HOST | The hostname of your LDAP server |
| LDAP_PORT | Port for your LDAP server |
Expand All @@ -57,19 +59,27 @@ services:
- COMPANY_NAME=Company
- SUPPORT_URL=https://autodiscover.example.com
- DOMAIN=example.com
# IMAP configuration (host mandatory to enable)
- IMAP_HOST=imap.example.com
- IMAP_PORT=993
- IMAP_SOCKET=SSL
# POP configuration (host mandatory to enable)
- POP_HOST=pop3.example.com
- POP_PORT=995
- POP_SOCKET=SSL
# SMTP configuration (host mandatory to enable)
- SMTP_HOST=smtp.example.com
- SMTP_PORT=587
- SMTP_SOCKET=STARTTLS
# LDAP configuration (host mandatory to enable)
- LDAP_HOST=ldap.example.com
- LDAP_PORT=636
- LDAP_SOCKET=SSL
- LDAP_BASE=dc=ldap,dc=example,dc=com
- LDAP_USER_FIELD=uid
- LDAP_USER_BASE=ou=People,dc=ldap,dc=example,dc=com
- LDAP_SEARCH=(|(objectClass=PostfixBookMailAccount))
# Apple mobile config identifiers (identifier mandatory to enable)
- PROFILE_IDENTIFIER=com.example.autodiscover
- PROFILE_UUID=92943D26-CAB3-4086-897D-DC6C0D8B1E86
- MAIL_UUID=7A981A9E-D5D0-4EF8-87FE-39FD6A506FAC
Expand All @@ -92,19 +102,27 @@ services:
- COMPANY_NAME=Company
- SUPPORT_URL=https://autodiscover.example.com
- DOMAIN=example.com
# IMAP configuration (host mandatory to enable)
- IMAP_HOST=imap.example.com
- IMAP_PORT=993
- IMAP_SOCKET=SSL
# POP configuration (host mandatory to enable)
- POP_HOST=pop3.example.com
- POP_PORT=995
- POP_SOCKET=SSL
# SMTP configuration (host mandatory to enable)
- SMTP_HOST=smtp.example.com
- SMTP_PORT=587
- SMTP_SOCKET=STARTTLS
# LDAP configuration (host mandatory to enable)
- LDAP_HOST=ldap.example.com
- LDAP_PORT=636
- LDAP_SOCKET=SSL
- LDAP_BASE=dc=ldap,dc=example,dc=com
- LDAP_USER_FIELD=uid
- LDAP_USER_BASE=ou=People,dc=ldap,dc=example,dc=com
- LDAP_SEARCH=(|(objectClass=PostfixBookMailAccount))
# Apple mobile config identifiers (identifier mandatory to enable)
- PROFILE_IDENTIFIER=com.example.autodiscover
- PROFILE_UUID=92943D26-CAB3-4086-897D-DC6C0D8B1E86
- MAIL_UUID=7A981A9E-D5D0-4EF8-87FE-39FD6A506FAC
Expand Down
12 changes: 8 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function *autodiscover() {
}

const imapenc = settings.imap.socket === "STARTTLS" ? "TLS" : settings.imap.socket;
const popenc = settings.pop.socket === "STARTTLS" ? "TLS" : settings.pop.socket;
const smtpenc = settings.smtp.socket === "STARTTLS" ? "TLS" : settings.smtp.socket;

yield this.render("autodiscover", {
Expand All @@ -59,6 +60,7 @@ function *autodiscover() {
username,
domain,
imapenc,
popenc,
smtpenc
});
}
Expand Down Expand Up @@ -99,8 +101,9 @@ router.get("/email.mobileconfig", function *autoconfig() {

const filename = `${domain}.mobileconfig`;

const inssl = settings.imap.socket === "SSL" || settings.imap.socket === "STARTTLS" ? "true" : "false";
const outssl = settings.smtp.socket === "SSL" || settings.smtp.socket === "STARTTLS" ? "true" : "false";
const imapssl = settings.imap.socket === "SSL" || settings.imap.socket === "STARTTLS" ? "true" : "false";
const popssl = settings.pop.socket === "SSL" || settings.pop.socket === "STARTTLS" ? "true" : "false";
const smtpssl = settings.smtp.socket === "SSL" || settings.smtp.socket === "STARTTLS" ? "true" : "false";
const ldapssl = settings.ldap.socket === "SSL" || settings.ldap.port === "636" ? "true" : "false";

this.set("Content-Type", "application/x-apple-aspen-config; charset=utf-8");
Expand All @@ -110,8 +113,9 @@ router.get("/email.mobileconfig", function *autoconfig() {
email,
username,
domain,
inssl,
outssl,
imapssl,
popssl,
smtpssl,
ldapssl
});
});
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "autodiscover-email-settings",
"version": "1.3.0",
"version": "1.4.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 Expand Up @@ -37,6 +37,7 @@
"koa-buddy": "^0.1.0",
"koa-router": "^5.1.2",
"koa-swig": "^2.0.0",
"minimist": "^1.2.5"
"minimist": "^1.2.5",
"qs": "^6.9.3"
}
}
5 changes: 5 additions & 0 deletions settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ module.exports = {
port: process.env.IMAP_PORT,
socket: process.env.IMAP_SOCKET
},
pop: {
host: process.env.POP_HOST,
port: process.env.POP_PORT,
socket: process.env.POP_SOCKET
},
smtp: {
host: process.env.SMTP_HOST,
port: process.env.SMTP_PORT,
Expand Down
14 changes: 14 additions & 0 deletions views/autoconfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,35 @@
<displayName>{{info.name}} Email</displayName>
<displayShortName>%EMAILLOCALPART%</displayShortName>

{%- if imap.host %}
<incomingServer type="imap">
<hostname>{{imap.host}}</hostname>
<port>{{imap.port}}</port>
<socketType>{{imap.socket}}</socketType>
<authentication>password-cleartext</authentication>
<username>%EMAILADDRESS%</username>
</incomingServer>
{% endif -%}

{%- if pop.host %}
<incomingServer type="pop3">
<hostname>{{pop.host}}</hostname>
<port>{{pop.port}}</port>
<socketType>{{pop.socket}}</socketType>
<authentication>password-cleartext</authentication>
<username>%EMAILADDRESS%</username>
</incomingServer>
{% endif -%}

{%- if smtp.host %}
<outgoingServer type="smtp">
<hostname>{{smtp.host}}</hostname>
<port>{{smtp.port}}</port>
<socketType>{{smtp.socket}}</socketType>
<authentication>password-cleartext</authentication>
<username>%EMAILADDRESS%</username>
</outgoingServer>
{% endif -%}

<documentation url="{{info.url}}">
<descr lang="en">Generic settings page</descr>
Expand Down
Loading

0 comments on commit 9a5c8b5

Please sign in to comment.