Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mail #65

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 86 additions & 0 deletions jobs/services/mail/autodiscover.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
job "autodiscover" {
datacenters = ["aperture"]

type = "service"

meta {
tld = "rb.dcu.ie"
mail = "mail.rb.dcu.ie"
}

group "autodiscover" {
count = 1

network {
port "http" {
to = 8000
}
}

service {
name = "autodiscover"
port = "http"

check {
type = "http"
path = "/"
interval = "10s"
timeout = "2s"
}

tags = [
"traefik.enable=true",
"traefik.http.routers.autodiscover.rule=Host(`autoconfig.${NOMAD_META_tld}`) || Host(`autodiscover.${NOMAD_META_tld}`)",
"traefik.http.routers.autodiscover.entrypoints=web,websecure",
"traefik.http.routers.autodiscover.tls.certresolver=lets-encrypt",
]
}

task "autodiscover" {
driver = "docker"

config {
image = "monogramm/autodiscover-email-settings:latest"
ports = ["http"]
}

template {
data = <<EOF
COMPANY_NAME=Redbrick
SUPPORT_URL=https://autodiscover.{{ env "NOMAD_META_tld" }}
DOMAIN={{ env "NOMAD_META_tld" }}
# IMAP configuration (host mandatory to enable)
IMAP_HOST={{ env "NOMAD_META_mail" }}
IMAP_PORT=993
IMAP_SOCKET=SSL
# POP configuration (host mandatory to enable)
POP_HOST={{ env "NOMAD_META_mail" }}
POP_PORT=995
POP_SOCKET=SSL
# SMTP configuration (host mandatory to enable)
SMTP_HOST={{ env "NOMAD_META_mail" }}
SMTP_PORT=587
SMTP_SOCKET=STARTTLS
# MobileSync/ActiveSync configuration (url mandatory to enable)
# MOBILESYNC_URL=https://sync.example.com
# MOBILESYNC_NAME=sync.example.com
# 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
# LDAP_UUID=6ECB6BA9-2208-4ABF-9E60-4E9F4CD7309E
EOF
destination = "local/autodiscover.env"
env = true
}
}
}
}
Loading