0

I have a proble with poste.io and configuration with nginx-proxy. DOMAIN is valid domain :)

This is my docker-compose for poste.io:

version: '3'

volumes:
  mailserver_posteio:

services:
  mailserver:
    image: analogic/poste.io
    container_name: poste-io
    restart: always
    ports:
      - "25:25"
      - "110:110"
      - "143:143"
      - "587:587"
      - "993:993"
      - "995:995"
      - "4190:4190"
    environment:
      - LETSENCRYPT_EMAIL=ssl@DOMAIN
      - LETSENCRYPT_HOST=mail.DOMAIN
      - VIRTUAL_HOST=mail.DOMAIN
      - HTTPS=OFF
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - mailserver_posteio:/data
      - ./nginx-proxy/html/.well-known:/opt/www/.well-known # this is correct path

networks:
  default:
    external:
      name: nginx-proxy

And this is configuration for nginx-proxy:

version: '3'

services:
  nginx:
    image: nginx
    restart: always
    container_name: nginx-proxy
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./conf:/etc/nginx/conf.d
      - ./vhost:/etc/nginx/vhost.d
      - ./html:/usr/share/nginx/html
      - ./certs:/etc/nginx/certs
    labels:
      - "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy=true"

  dockergen:
    image: jwilder/docker-gen
    restart: always
    container_name: nginx-proxy-gen
    depends_on:
      - nginx
    command: -notify-sighup nginx-proxy -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
    volumes:
      - ./conf:/etc/nginx/conf.d
      - ./vhost:/etc/nginx/vhost.d
      - ./html:/usr/share/nginx/html
      - ./certs:/etc/nginx/certs
      - /var/run/docker.sock:/tmp/docker.sock:ro
      - ./nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro

  letsencrypt:
    restart: always
    image: jrcs/letsencrypt-nginx-proxy-companion
    container_name: nginx-proxy-le
    depends_on:
      - nginx
      - dockergen
    environment:
      NGINX_PROXY_CONTAINER: nginx-proxy
      NGINX_DOCKER_GEN_CONTAINER: nginx-proxy-gen
    volumes:
      - ./conf:/etc/nginx/conf.d
      - ./vhost:/etc/nginx/vhost.d
      - ./html:/usr/share/nginx/html
      - ./certs:/etc/nginx/certs
      - /var/run/docker.sock:/var/run/docker.sock:ro

networks:
  default:
    external:
      name: nginx-proxy

Almost everything works fine (I can login into dashboard with https, send and receive mail via roundcube), but I can't login to mail account by mail application like Thunderbird.

I've got error that my username or password is incorrect. I've double checked and username and password is ok.

So I login into poste.io container and in logs I found this one:

Oct 19 11:21:02 2d4556c1f79e dovecot: imap-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=130.255.154.136, lip=172.18.0.2, TLS handshaking: SSL_accept() failed: error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate: SSL alert number 42, s
ession=<e4MPbJF478OC/5qI>
Oct 19 11:21:02 2d4556c1f79e dovecot: imap-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=130.255.154.136, lip=172.18.0.2, TLS handshaking: SSL_accept() failed: error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate: SSL alert number 42, s
ession=<WUscbJF48MOC/5qI>
Oct 19 11:21:19 2d4556c1f79e dovecot: imap-login: Aborted login (no auth attempts in 0 secs): user=<>, rip=130.255.154.136, lip=172.18.0.2, session=<ZYgVbZF49MOC/5qI>
Oct 19 11:21:35 2d4556c1f79e dovecot: imap-login: Disconnected (no auth attempts in 1 secs): user=<>, rip=130.255.154.136, lip=172.18.0.2, TLS handshaking: SSL_accept() failed: error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate: SSL alert number 42, s
ession=<4qwFbpF4+MOC/5qI>

So I logged into dashboard and clicked button to get TLS Certificate. After that I can see in dashboard in log section this:

[2018-10-19 10:55:08] LEScript.INFO: Account already registered. Continuing.
[2018-10-19 10:55:08] LEScript.INFO: Starting certificate generation process for domains
[2018-10-19 10:55:08] LEScript.INFO: Requesting challenge for mail.DOMAIN
[2018-10-19 10:55:08] LEScript.INFO: Sending signed request to /acme/new-authz
[2018-10-19 10:55:09] LEScript.INFO: Got challenge token for mail.DOMAIN
[2018-10-19 10:55:09] LEScript.INFO: Token for mail.DOMAIN saved at /opt/www//.well-known/acme-challenge/jIWGGbQdxk5GDjpqRaZ0ZJVnJTJZFLrz1xqkV6sQV3Q and should be available at http://mail.DOMAIN/.well-known/acme-challenge/jIWGGbQdxk5GDjpqRaZ0ZJVnJTJZFLrz1xqkV6sQV3Q
[2018-10-19 10:55:09] LEScript.INFO: Sending request to challenge
[2018-10-19 10:55:09] LEScript.INFO: Sending signed request to https://acme-v01.api.letsencrypt.org/acme/challenge/aMXIOU7RCsAynJEYLJqKvT2WkcA_1tB7dR76yOjEh6E/8431476684
[2018-10-19 10:55:10] LEScript.INFO: Verification ended with status: valid
[2018-10-19 10:55:10] LEScript.INFO: Sending signed request to /acme/new-cert

How can I resolve it ?

The weirdest is issue appear from 2.0.16 version. On 2.0.15 everything works !

0

I found solution. Solution is use external volume for well-known. After that in Poste.io attach external volume to

well-known:/opt/www/.well-known

And

well-known:/usr/share/nginx/html/.well-known

For each nginx container.

After that you can call TLS certificate for Poste.io .

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.