Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Verified Commit afd793fd authored by Florent VINCENT's avatar Florent VINCENT 👾
Browse files

replace automx with autodiscover

parent 743fc7ce
Loading
Loading
Loading
Loading

config/automx/.keep

deleted100644 → 0
+0 −0

Empty file deleted.

+7 −4
Original line number Diff line number Diff line
@@ -78,9 +78,12 @@ echo "$DOMAIN,$VIRTUAL_HOST,mail.$DOMAIN,spam.$DOMAIN,welcome.$DOMAIN" | tr ","
:; done


# Configure automx
cat templates/automx/automx.conf | sed "s/@@@DOMAIN@@@/$DOMAIN/g" > "config/automx/automx.conf"
chown www-data:www-data "config/automx/automx.conf"
# Configure autodiscover
#Generate 2 random UUIDs
UUID1=$(cat /proc/sys/kernel/random/uuid)
UUID2=$(cat /proc/sys/kernel/random/uuid)
echo "AUTODISCOVER_AM_UUID=$UUID1" >> "$ENVFILE"
echo "AUTODISCOVER_AP_UUID=$UUID2" >> "$ENVFILE"

# Configure rspamd whitelist
cat templates/mail/rspamd/ecloud/whitelist.sender.domain.map | sed "s/@@@DOMAIN@@@/$DOMAIN/g" > "config/mail/rspamd/ecloud/whitelist.sender.domain.map"
@@ -91,7 +94,7 @@ chown -R 107:109 "config/mail/rspamd/ecloud/"

# Configure nginx vhost

# automx
# autodiscover
echo "$DOMAIN,$ADD_DOMAINS" | tr "," "\n" | while read CURDOMAIN; do
    cat "templates/nginx/sites-enabled/autoconfig.conf" | sed "s/@@@DOMAIN@@@/$CURDOMAIN/g" | sed "s/@@@SERVICE@@@/autoconfig/g" > "config/nginx/sites-enabled/autoconfig.$CURDOMAIN.conf"
    cat "templates/nginx/sites-enabled/autoconfig.conf" | sed "s/@@@DOMAIN@@@/$CURDOMAIN/g" | sed "s/@@@SERVICE@@@/autodiscover/g" > "config/nginx/sites-enabled/autodiscover.$CURDOMAIN.conf"

templates/automx/automx.conf

deleted100644 → 0
+0 −56
Original line number Diff line number Diff line
# file: /etc/automx.conf

[automx]
provider = @@@DOMAIN@@@
domains = *

#debug = yes
#logfile = /var/log/automx/automx.log

# Protect against DoS
#memcache = 127.0.0.1:11211
#memcache_ttl = 600
#client_error_limit = 20
#rate_limit_exception_networks = 127.0.0.0/8, ::1/128

# The DEFAULT section is always merged into each other section. Each section
# can overwrite settings done here.
[DEFAULT]
account_type = email
account_name = %s
account_name_short = %s


# If a domain is listed in the automx section, it may have its own section. If
# none is found here, the global section is used.
[global]
backend = static
action = settings


# If you want to sign mobileconfig profiles, enable these options. Make sure
# that your webserver has proper privileges to read the key. The cert file
# must contain the server certificate and all intermediate certificates. You
# can simply concatenate these certificates.
#sign_mobileconfig = yes
#sign_cert = /certs/autodiscover.eelo.io.crt
#sign_key = /certs/autodiscover.eelo.io.key

smtp = yes
smtp_server = mail.@@@DOMAIN@@@
smtp_port = 587
smtp_encryption = starttls
smtp_auth = plaintext
smtp_auth_identity = %s
smtp_refresh_ttl = 6
smtp_default = yes

imap = yes
imap_server = mail.@@@DOMAIN@@@
imap_port = 993
imap_encryption = ssl
imap_auth = plaintext
imap_auth_identity = %s
imap_refresh_ttl = 6

pop = no
+14 −13
Original line number Diff line number Diff line
@@ -153,19 +153,20 @@ services:
      - mariadb
      - redis

  automx:
    image: registry.gitlab.e.foundation/e/infra/docker-mailstack:automx-0.1.0
    container_name: automx
    hostname: automx
  mail-autodiscover-autoconfig:
    image: wdes/mail-autodiscover-autoconfig:latest
    name: mail-autodiscover-autoconfig
    mem_limit: 120M
    mem_reservation: 50M
    restart: on-failure:40
    environment:
      - VIRTUAL_HOST=${VIRTUAL_HOST}
      - DOMAIN=${DOMAIN}
      - HOSTNAME=automx
    restart: always
    networks:
      - default
    volumes:
      - /mnt/repo-base/config/automx/automx.conf:/etc/automx.conf
        ROCKET_PROFILE: production
        ROCKET_ADDRESS: "0.0.0.0"
        ROCKET_PORT: "80"
        APPLE_MAIL_UUID: ${AUTODISCOVER_AM_UUID}
        APPLE_PROFILE_UUID: ${AUTODISCOVER_AP_UUID}
        IMAP_HOSTNAME: ${SMTP_HOST}
        SMTP_HOSTNAME: ${SMTP_HOST}

  nginx:
    image: nginx:stable-alpine
@@ -185,7 +186,7 @@ services:
      - /mnt/repo-base/volumes/nextcloud/html:/var/www/html
    depends_on:
      - nextcloud
      - automx
      - mail-autodiscover-autoconfig
      - postfixadmin
      - welcome
      - mailserver
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ server {
  #auth_basic_user_file /passwds/<NAME>.htpasswd;

  location / {
    proxy_pass http://automx:80;
    proxy_pass http://mail-autodiscover-autoconfig:80;
    include /etc/nginx/params/proxy_params;
  }
}