zokradonh / kopano-docker

Unofficial Kopano Docker images for all Kopano services.
MIT License
59 stars 37 forks source link

hostname is wrong #333

Closed theoneandonly-vector closed 4 years ago

theoneandonly-vector commented 4 years ago

somehow the server sends "mail.mail.hostname.tld" instead fo "mail.hostname.tld"

fbartels commented 4 years ago

I'm wondering: why are you ignoring the issue templates and the troubleshooting information contained in then?

theoneandonly-vector commented 4 years ago

Describe the bug I used "mail.domain.tld" everywhere.. but when I send an email it sends it as "mail.mail.domain.tld".

To Reproduce my configuration (docker-compose config)=

root@ubuntudockerhost:/opt/kopano-docker# docker-compose config
networks:
  kopano-net:
    driver: bridge
  web-net: {}
services:
  db:
    container_name: kopano_db
    environment:
      MYSQL_DATABASE: kopano
      MYSQL_PASSWORD: **************************
      MYSQL_ROOT_PASSWORD: *************************
      MYSQL_USER: kopano
    healthcheck:
      interval: 30s
      retries: 4
      test:
      - CMD-SHELL
      - mysql --database=$$MYSQL_DATABASE --password=$$MYSQL_ROOT_PASSWORD --execute="SELECT
        count(table_name) > 0 FROM information_schema.tables;" --skip-column-names
        -B
      timeout: 10s
    image: mariadb:10.3.10-bionic
    networks:
      kopano-net: {}
    restart: unless-stopped
    volumes:
    - mysql:/var/lib/mysql:rw
  kopano_dagent:
    depends_on:
    - kopano_server
    environment:
      KCCONF_DAGENT_LOG_LEVEL: '3'
      KCCONF_DAGENT_SSLKEY_FILE: /kopano/ssl/kopano_dagent.pem
      SERVICE_TO_START: dagent
      TZ: Europe/Zurich
    image: zokradonh/kopano_core:latest
    networks:
      kopano-net: {}
    read_only: true
    restart: unless-stopped
    tmpfs:
    - /tmp
    volumes:
    - /etc/machine-id:/etc/machine-id:rw
    - kopanossl:/kopano/ssl:rw
    - kopanosocket:/run/kopano:rw
    - /var/lib/dbus/machine-id:/var/lib/dbus/machine-id:rw
  kopano_gateway:
    depends_on:
    - kopano_server
    environment:
      KCCONF_GATEWAY_LOG_LEVEL: '3'
      KCCONF_GATEWAY_SERVER_SOCKET: http://kopano_server:236/
      SERVICE_TO_START: gateway
      TZ: Europe/Zurich
    image: zokradonh/kopano_core:latest
    networks:
      kopano-net: {}
    ports:
    - published: 110
      target: 110
    - published: 143
      target: 143
    read_only: true
    restart: unless-stopped
    tmpfs:
    - /tmp
    volumes:
    - /etc/machine-id:/etc/machine-id:rw
    - kopanossl:/kopano/ssl:rw
    - kopanosocket:/run/kopano:rw
    - /var/lib/dbus/machine-id:/var/lib/dbus/machine-id:rw
  kopano_grapi:
    container_name: kopano_grapi
    depends_on:
    - kopano_server
    environment:
      KCCONF_GRAPI_ENABLE_EXPERIMENTAL_ENDPOINTS: "no"
      KCCONF_GRAPI_INSECURE: "no"
      KCCONF_GRAPI_PERSISTENCY_PATH: /var/lib/kopano-grapi
      SERVICE_TO_START: grapi
      TZ: Europe/Zurich
    image: zokradonh/kopano_core:latest
    networks:
      kopano-net: {}
      web-net: {}
    read_only: true
    restart: unless-stopped
    tmpfs:
    - /tmp/
    volumes:
    - /etc/machine-id:/etc/machine-id:rw
    - kopanosocket:/run/kopano:rw
    - /var/lib/dbus/machine-id:/var/lib/dbus/machine-id:rw
    - kopanograpi:/var/lib/kopano-grapi:rw
  kopano_ical:
    depends_on:
    - kopano_server
    environment:
      KCCONF_ICAL_SERVER_SOCKET: http://kopano_server:236/
      SERVICE_TO_START: ical
      TZ: Europe/Zurich
    image: zokradonh/kopano_core:latest
    networks:
      kopano-net: {}
      web-net: {}
    ports:
    - published: 8080
      target: 8080
    read_only: true
    restart: unless-stopped
    tmpfs:
    - /tmp
    volumes:
    - /etc/machine-id:/etc/machine-id:rw
    - kopanossl:/kopano/ssl:rw
    - kopanosocket:/run/kopano:rw
    - /var/lib/dbus/machine-id:/var/lib/dbus/machine-id:rw
  kopano_kapi:
    container_name: kopano_kapi
    depends_on:
    - kopano_grapi
    environment:
      KCCONF_KAPID_INSECURE: "no"
      KCCONF_KAPID_LOG_LEVEL: DEBUG
      KCCONF_KAPID_OIDC_ISSUER_IDENTIFIER: https://mail.domain.tld
      SERVICE_TO_START: kapi
      TZ: Europe/Zurich
    image: zokradonh/kopano_core:latest
    networks:
      kopano-net: {}
      web-net: {}
    read_only: true
    restart: unless-stopped
    tmpfs:
    - /tmp
    volumes:
    - /etc/machine-id:/etc/machine-id:rw
    - kopanodata:/kopano/data:rw
    - kopanossl:/kopano/ssl:rw
    - kopanosocket:/run/kopano:rw
    - /var/lib/dbus/machine-id:/var/lib/dbus/machine-id:rw
  kopano_kdav:
    container_name: kopano_kdav
    depends_on:
    - kopano_server
    environment:
      TZ: Europe/Zurich
    hostname: kopano_kdav
    image: zokradonh/kopano_kdav:latest
    networks:
      kopano-net: {}
      web-net: {}
    read_only: true
    restart: unless-stopped
    tmpfs:
    - /run/apache2/
    - /run/sessions/
    - /tmp
    - /var/log/kdav/
    volumes:
    - /etc/machine-id:/etc/machine-id:rw
    - kopanossl:/kopano/ssl:rw
    - kopanosocket:/run/kopano:rw
    - /var/lib/dbus/machine-id:/var/lib/dbus/machine-id:rw
    - kdavstates:/var/lib/kopano/kdav:rw
  kopano_konnect:
    depends_on:
    - kopano_ssl
    - web
    environment:
      FQDN: mail.domain.tld
      allow_client_guests: "yes"
      allow_dynamic_client_registration: "yes"
      eckey: /kopano/ssl/meet-kwmserver.pem
      ecparam: /kopano/ssl/ecparam.pem
      encryption_secret_key: /kopano/ssl/konnectd-encryption.key
      identifier_registration_conf: /kopano/ssl/konnectd-identifier-registration.yaml
      identifier_scopes_conf: /etc/kopano/konnectd-identifier-scopes.yaml
      signing_private_key: /kopano/ssl/konnectd-tokens-signing-key.pem
      validation_keys_path: /kopano/ssl/konnectkeys
    image: zokradonh/kopano_konnect:latest
    networks:
      kopano-net: {}
      web-net: {}
    read_only: true
    restart: unless-stopped
    tmpfs:
    - /tmp
    volumes:
    - /etc/machine-id:/etc/machine-id:rw
    - kopanossl:/kopano/ssl:rw
    - kopanosocket:/run/kopano:rw
    - /var/lib/dbus/machine-id:/var/lib/dbus/machine-id:rw
  kopano_kustomer:
    command: serve --log-level debug
    image: kopano/kustomerd:latest
    read_only: true
    restart: unless-stopped
    volumes:
    - kopanolicenses:/etc/kopano/licenses:rw
    - /etc/machine-id:/etc/machine-id:rw
    - kopanosocket:/run/kopano:rw
    - /var/lib/dbus/machine-id:/var/lib/dbus/machine-id\:rw
  kopano_kwmserver:
    command: wrapper.sh
    depends_on:
    - kopano_kapi
    - kopano_konnect
    environment:
      INSECURE: "no"
      enable_guest_api: "yes"
      oidc_issuer_identifier: https://mail.domain.tld
      public_guest_access_regexp: ^group/public/.*
    image: zokradonh/kopano_kwmserver:latest
    networks:
      web-net: {}
    read_only: true
    restart: unless-stopped
    tmpfs:
    - /tmp
    volumes:
    - /etc/machine-id:/etc/machine-id:rw
    - kopanossl:/kopano/ssl:rw
    - /var/lib/dbus/machine-id:/var/lib/dbus/machine-id:rw
  kopano_meet:
    depends_on:
    - kopano_kapi
    - kopano_konnect
    - kopano_kwmserver
    - web
    environment:
      KCCONF_MEET_disableFullGAB: "false"
      KCCONF_MEET_guests_enabled: "true"
      KCCONF_MEET_minimumVersion: '20200121'
      KCCONF_MEET_oidc_useImplicitFlow: "true"
      SERVICE_TO_START: meet
    image: zokradonh/kopano_meet:latest
    networks:
      web-net: {}
    read_only: true
    restart: unless-stopped
    tmpfs:
    - /tmp
    volumes:
    - /etc/machine-id:/etc/machine-id:rw
    - /var/lib/dbus/machine-id:/var/lib/dbus/machine-id:rw
  kopano_monitor:
    depends_on:
    - kopano_server
    environment:
      SERVICE_TO_START: monitor
      TZ: Europe/Zurich
    image: zokradonh/kopano_core:latest
    networks:
      kopano-net: {}
    read_only: true
    restart: unless-stopped
    tmpfs:
    - /tmp
    volumes:
    - /etc/machine-id:/etc/machine-id:rw
    - kopanossl:/kopano/ssl:rw
    - kopanosocket:/run/kopano:rw
    - /var/lib/dbus/machine-id:/var/lib/dbus/machine-id:rw
  kopano_scheduler:
    container_name: kopano_scheduler
    depends_on:
    - kopano_server
    - kopano_zpush
    environment:
      CRONDELAYED_KBACKUP: 30 1 * * * docker run --rm -it --volumes-from kopano_server
        -v /root/kopano-backup:/kopano/path zokradonh/kopano_utils:latest kopano-backup
        -h
      CRONDELAYED_SOFTDELETE: 30 2 * * * docker exec kopano_server kopano-admin --purge-softdelete
        30
      CRON_KOPANOUSERS: 10 * * * * docker exec kopano_server kopano-admin --sync
      CRON_ZPUSHGAB: 0 22 * * * docker exec kopano_zpush z-push-gabsync -a sync
      TZ: Europe/Zurich
    image: zokradonh/kopano_scheduler:latest
    networks:
      kopano-net: {}
      web-net: {}
    read_only: true
    restart: "no"
    tmpfs:
    - /tmp
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock:ro
  kopano_search:
    container_name: kopano_search
    depends_on:
    - kopano_server
    environment:
      SERVICE_TO_START: search
      TZ: Europe/Zurich
    image: zokradonh/kopano_core:latest
    networks:
      kopano-net: {}
    read_only: true
    restart: unless-stopped
    tmpfs:
    - /tmp
    volumes:
    - /etc/machine-id:/etc/machine-id:rw
    - kopanodata:/kopano/data:rw
    - kopanossl:/kopano/ssl:rw
    - kopanosocket:/run/kopano:rw
    - /var/lib/dbus/machine-id:/var/lib/dbus/machine-id:rw
  kopano_server:
    container_name: kopano_server
    depends_on:
    - db
    - kopano_konnect
    - kopano_ssl
    environment:
      ADDITIONAL_KOPANO_PACKAGES: '""'
      KCCOMMENT_LDAP_1: '!include /usr/share/kopano/ldap.active-directory.cfg'
      KCCONF_ADMIN_DEFAULT_STORE_LOCALE: de_DE.UTF-8
      KCCONF_LDAP_LDAP_BIND_PASSWD: *******************************************
      KCCONF_LDAP_LDAP_BIND_USER: uid=kopanodockerubuntu,cn=users,dc=domain,dc=tld
      KCCONF_LDAP_LDAP_EMAILALIASES_ATTRIBUTE: MAILALTERNATIVEADDRESS
      KCCONF_LDAP_LDAP_GROUPMEMBERS_ATTRIBUTE: UNIQUEMEMBER
      KCCONF_LDAP_LDAP_GROUPMEMBERS_ATTRIBUTE_TYPE: DN
      KCCONF_LDAP_LDAP_GROUP_SEARCH_FILTER: (&(KOPANOACCOUNT=1)(OBJECTCLASS=KOPANO-GROUP))
      KCCONF_LDAP_LDAP_LOGINNAME_ATTRIBUTE: MAILPRIMARYADDRESS
      KCCONF_LDAP_LDAP_NONACTIVE_ATTRIBUTE: KOPANOSHAREDSTOREONLY
      KCCONF_LDAP_LDAP_QUOTA_MULTIPLIER: '1048576'
      KCCONF_LDAP_LDAP_SEARCH_BASE: dc=domain,dc=tld
      KCCONF_LDAP_LDAP_SENDAS_RELATION_ATTRIBUTE: UIDNUMBER
      KCCONF_LDAP_LDAP_URI: ldap://10.255.255.1:7389
      KCCONF_LDAP_LDAP_USER_SEARCH_FILTER: (KOPANOACCOUNT=1)
      KCCONF_LDAP_LDAP_USER_TYPE_ATTRIBUTE_VALUE: KOPANO-USER
      KCCONF_LDAP_LDAP_USER_UNIQUE_ATTRIBUTE: ENTRYUUID
      KCCONF_SERVER_COREDUMP_ENABLED: "no"
      KCCONF_SERVER_ENABLE_SSO: "yes"
      KCCONF_SERVER_KCOIDC_INSECURE_SKIP_VERIFY: "no"
      KCCONF_SERVER_KCOIDC_ISSUER_IDENTIFIER: https://mail.domain.tld
      KCCONF_SERVER_MYSQL_DATABASE: kopano
      KCCONF_SERVER_MYSQL_HOST: db
      KCCONF_SERVER_MYSQL_PASSWORD: ***********************************
      KCCONF_SERVER_MYSQL_PORT: '3306'
      KCCONF_SERVER_MYSQL_USER: kopano
      KCCONF_SERVER_PROXY_HEADER: '*'
      KCCONF_SERVER_SERVER_NAME: Kopano
      KCCONF_SERVER_SERVER_SSL_CA_FILE: /kopano/ssl/ca.pem
      KCCONF_SERVER_SERVER_SSL_KEY_FILE: /kopano/ssl/kopano_server.pem
      KCCONF_SERVER_SSLKEYS_PATH: /kopano/ssl/clients
      KCCONF_SERVER_SYSTEM_EMAIL_ADDRESS: postmaster@domain.tld
      KCUNCOMMENT_LDAP_1: '!include /usr/share/kopano/ldap.openldap.cfg'
      SERVICE_TO_START: server
      TZ: Europe/Zurich
    hostname: kopano_server
    image: zokradonh/kopano_core:latest
    networks:
      kopano-net: {}
      web-net: {}
    ports:
    - published: 236
      target: 236
    - published: 237
      target: 237
    read_only: true
    restart: unless-stopped
    tmpfs:
    - /tmp/
    volumes:
    - /etc/machine-id:/etc/machine-id:rw
    - kopanodata:/kopano/data:rw
    - kopanossl:/kopano/ssl:rw
    - kopanosocket:/run/kopano:rw
    - /var/lib/dbus/machine-id:/var/lib/dbus/machine-id:rw
  kopano_spooler:
    depends_on:
    - kopano_server
    - mail
    domainname: mail.domain.tld
    environment:
      KCCONF_SPOOLER_LOG_LEVEL: '3'
      KCCONF_SPOOLER_SMTP_SERVER: mail
      KCCONF_SPOOLER_SSLKEY_FILE: /kopano/ssl/kopano_spooler.pem
      SERVICE_TO_START: spooler
      TZ: Europe/Zurich
    hostname: spooler
    image: zokradonh/kopano_core:latest
    networks:
      kopano-net: {}
    read_only: true
    restart: unless-stopped
    tmpfs:
    - /tmp
    volumes:
    - /etc/machine-id:/etc/machine-id:rw
    - kopanossl:/kopano/ssl:rw
    - kopanosocket:/run/kopano:rw
    - /var/lib/dbus/machine-id:/var/lib/dbus/machine-id:rw
  kopano_ssl:
    environment:
      FQDN: mail.domain.tld
      PKI_COUNTRY: NL
    image: zokradonh/kopano_ssl:latest
    read_only: true
    tmpfs:
    - /kopano/easypki/
    volumes:
    - kopanossl:/kopano/ssl:rw
  kopano_webapp:
    depends_on:
    - kopano_server
    environment:
      ADDITIONAL_KOPANO_WEBAPP_PLUGINS: '""'
      KCCONF_WEBAPP_OIDC_CLIENT_ID: webapp
      KCCONF_WEBAPP_OIDC_ISS: https://mail.domain.tld
      TZ: Europe/Zurich
    hostname: kopano_webapp
    image: zokradonh/kopano_webapp:latest
    networks:
      kopano-net: {}
      web-net: {}
    read_only: true
    restart: unless-stopped
    tmpfs:
    - /tmp/
    - /run/sessions/
    - /run/php/
    - /var/log/
    volumes:
    - /etc/machine-id:/etc/machine-id:rw
    - kopanossl:/kopano/ssl:rw
    - kopanosocket:/run/kopano:rw
    - /var/lib/dbus/machine-id:/var/lib/dbus/machine-id:rw
    - kopanowebapp:/var/lib/kopano-webapp:rw
  kopano_zpush:
    container_name: kopano_zpush
    depends_on:
    - kopano_server
    environment:
      TZ: Europe/Zurich
      ZPUSH_ADDITIONAL_FOLDERS: '[]'
    hostname: kopano_zpush
    image: zokradonh/kopano_zpush:latest
    networks:
      kopano-net: {}
      web-net: {}
    read_only: true
    restart: unless-stopped
    tmpfs:
    - /run/apache2/
    - /run/sessions/
    - /tmp
    - /var/log/z-push/
    volumes:
    - /etc/machine-id:/etc/machine-id:rw
    - kopanossl:/kopano/ssl:rw
    - kopanosocket:/run/kopano:rw
    - /var/lib/dbus/machine-id:/var/lib/dbus/machine-id:rw
    - zpushstates:/var/lib/z-push:rw
  mail:
    cap_add:
    - NET_ADMIN
    - SYS_PTRACE
    container_name: kopano_mail
    domainname: mail.domain.tld
    environment:
      DMS_DEBUG: '0'
      ENABLE_CLAMAV: '1'
      ENABLE_FAIL2BAN: '1'
      ENABLE_LDAP: '1'
      ENABLE_POSTFIX_VIRTUAL_TRANSPORT: '1'
      ENABLE_POSTGREY: '1'
      ENABLE_SASLAUTHD: '1'
      ENABLE_SPAMASSASSIN: '1'
      LDAP_BIND_DN: uid=kopanodockerubuntu,cn=users,dc=domain,dc=tld
      LDAP_BIND_PW: **************************************
      LDAP_QUERY_FILTER_ALIAS: (&(kopanoAccount=1)(kopanoAliases=%s))
      LDAP_QUERY_FILTER_DOMAIN: (&(|(mail=*@%s)(kopanoAliases=*@%s)))
      LDAP_QUERY_FILTER_GROUP: (&(objectclass=kopano-group)(mail=%s))
      LDAP_QUERY_FILTER_USER: (&(kopanoAccount=1)(mail=%s))
      LDAP_SEARCH_BASE: dc=domain,dc=tld
      LDAP_SERVER_HOST: ldap://10.255.255.1:7389
      ONE_DIR: '1'
      PERMIT_DOCKER: connected-networks
      POSTFIX_DAGENT: lmtp:kopano_dagent:2003
      POSTMASTER_ADDRESS: postmaster@domain.tld
      REPORT_RECIPIENT: '1'
      SASLAUTHD_LDAP_BIND_DN: uid=kopanodockerubuntu,cn=users,dc=domain,dc=tld
      SASLAUTHD_LDAP_FILTER: (&(kopanoAccount=1)(uid=%s))
      SASLAUTHD_LDAP_PASSWORD: *************************************
      SASLAUTHD_LDAP_SEARCH_BASE: dc=domain,dc=tld
      SASLAUTHD_LDAP_SERVER: ldap://10.255.255.1:7389
      SASLAUTHD_MECHANISMS: ldap
      SMTP_ONLY: ''
      SSL_TYPE: self-signed
      TZ: Europe/Zurich
    hostname: mail
    image: tvial/docker-mailserver:release-v6.2.0
    networks:
      kopano-net: {}
    ports:
    - published: 25
      target: 25
    - published: 465
      target: 465
    - published: 587
      target: 587
    restart: unless-stopped
    volumes:
    - mtaconfig:/tmp/docker-mailserver:rw
    - maildata:/var/mail:rw
    - mailstate:/var/mail-state:rw
  web:
    command: wrapper.sh
    environment:
      DEFAULTREDIRECT: /webapp
      EMAIL: info@domain.tld
      FQDN: mail.domain.tld
    image: zokradonh/kopano_web:latest
    networks:
      web-net:
        aliases:
        - mail.domain.tld
    ports:
    - published: 80
      target: 80
    - published: 443
      target: 443
    - published: 2015
      target: 2015
    read_only: true
    restart: unless-stopped
    volumes:
    - web:/.kweb:rw
    - /etc/machine-id:/etc/machine-id:rw
    - /var/lib/dbus/machine-id:/var/lib/dbus/machine-id:rw
version: '3.5'
volumes:
  kdavstates: {}
  kopanodata: {}
  kopanograpi: {}
  kopanolicenses: {}
  kopanosocket: {}
  kopanossl: {}
  kopanowebapp: {}
  maildata: {}
  mailstate: {}
  mtaconfig: {}
  mysql: {}
  web: {}
  zpushstates: {}

Expected behavior the mail-server should use ""mail.domain.tld""

theoneandonly-vector commented 4 years ago

added config as a file: compose.cfg.txt

fbartels commented 4 years ago

If you use a code block instead of an inline formatting then its better displayed here on github (I updated your post).

When your FQDN is already mail.domain.tld, then the mail container indeed will (internally at least) use the FQDN mail.mail.domain.tld. The behaviour is controlled at https://github.com/zokradonh/kopano-docker/blob/f998cdb7b270cc839a958d65983893040fb7f927/docker-compose.mail.yml#L7-L8.

The idea behind the layout is that you would run this directly on your domain and then the mail receiving part is on the mail subdomain. The subdomain is not really required, though so you could also override this on your local system.

theoneandonly-vector commented 4 years ago

thx :)